Skip to content

Commit 5e7eed0

Browse files
committed
fix return value of parentVal and parentsVal
1 parent 8983d63 commit 5e7eed0

File tree

4 files changed

+8
-1
lines changed

4 files changed

+8
-1
lines changed

src/Field/Domain/Model/Field.php

+4
Original file line numberDiff line numberDiff line change
@@ -78,21 +78,25 @@ class Field
7878
public ?\DateTimeImmutable $dateVal = null;
7979

8080
#[ORM\ManyToOne(targetEntity: Community::class, inversedBy: 'fieldsAsCommunityVal')]
81+
#[Groups(['communities'])]
8182
public ?Community $communityVal = null;
8283

8384
/**
8485
* @var Collection<int, Community>
8586
*/
8687
#[ORM\ManyToMany(targetEntity: Community::class, inversedBy: 'fieldsAsCommunitiesVal')]
88+
#[Groups(['communities'])]
8789
public Collection $communitiesVal;
8890

8991
#[ORM\ManyToOne(targetEntity: Place::class, inversedBy: 'fieldsAsPlaceVal')]
92+
#[Groups(['places'])]
9093
public ?Place $placeVal = null;
9194

9295
/**
9396
* @var Collection<int, Place>
9497
*/
9598
#[ORM\ManyToMany(targetEntity: Place::class, inversedBy: 'fieldsAsPlacesVal')]
99+
#[Groups(['places'])]
96100
public Collection $placesVal;
97101

98102
#[ORM\ManyToOne(targetEntity: Agent::class, inversedBy: 'fields')]

src/FieldHolder/Community/Domain/Model/Community.php

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use Doctrine\Common\Collections\Collection;
1111
use Doctrine\ORM\Mapping as ORM;
1212
use Symfony\Component\Intl\Countries;
13+
use Symfony\Component\Serializer\Attribute\Groups;
1314
use Symfony\Component\Uid\Uuid;
1415
use Symfony\Component\Validator\Constraints as Assert;
1516
use Symfony\Component\Validator\Context\ExecutionContextInterface;
@@ -24,6 +25,7 @@ class Community extends FieldHolder
2425
#[ORM\Column(type: 'uuid', unique: true)]
2526
#[ORM\GeneratedValue(strategy: 'CUSTOM')]
2627
#[ORM\CustomIdGenerator(class: 'doctrine.uuid_generator')]
28+
#[Groups(['communities'])]
2729
public ?Uuid $id = null;
2830

2931
/**

src/FieldHolder/Community/Infrastructure/ApiPlatform/State/Processor/UpsertCommunityProcessor.php

-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ public function process(mixed $data, Operation $operation, array $uriVariables =
6969
foreach ($wikidataIdFields as $wikidataId => $fields) {
7070
$community = null;
7171
try {
72-
// var_dump($wikidataId);
7372
$community = new Community();
7473
$this->communityRepo->add($community);
7574

src/FieldHolder/Place/Domain/Model/Place.php

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use Doctrine\Common\Collections\Collection;
1111
use Doctrine\ORM\Mapping as ORM;
1212
use Symfony\Component\Intl\Countries;
13+
use Symfony\Component\Serializer\Annotation\Groups;
1314
use Symfony\Component\Uid\Uuid;
1415
use Symfony\Component\Validator\Constraints as Assert;
1516
use Symfony\Component\Validator\Context\ExecutionContextInterface;
@@ -24,6 +25,7 @@ class Place extends FieldHolder
2425
#[ORM\Column(type: 'uuid', unique: true)]
2526
#[ORM\GeneratedValue(strategy: 'CUSTOM')]
2627
#[ORM\CustomIdGenerator(class: 'doctrine.uuid_generator')]
28+
#[Groups(['places'])]
2729
public ?Uuid $id = null;
2830

2931
/**

0 commit comments

Comments
 (0)