Skip to content

Commit

Permalink
fix return value of parentVal and parentsVal
Browse files Browse the repository at this point in the history
  • Loading branch information
bailletced committed Jan 31, 2025
1 parent 8983d63 commit 5e7eed0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/Field/Domain/Model/Field.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,21 +78,25 @@ class Field
public ?\DateTimeImmutable $dateVal = null;

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

/**
* @var Collection<int, Community>
*/
#[ORM\ManyToMany(targetEntity: Community::class, inversedBy: 'fieldsAsCommunitiesVal')]
#[Groups(['communities'])]
public Collection $communitiesVal;

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

/**
* @var Collection<int, Place>
*/
#[ORM\ManyToMany(targetEntity: Place::class, inversedBy: 'fieldsAsPlacesVal')]
#[Groups(['places'])]
public Collection $placesVal;

#[ORM\ManyToOne(targetEntity: Agent::class, inversedBy: 'fields')]
Expand Down
2 changes: 2 additions & 0 deletions src/FieldHolder/Community/Domain/Model/Community.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Intl\Countries;
use Symfony\Component\Serializer\Attribute\Groups;
use Symfony\Component\Uid\Uuid;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
Expand All @@ -24,6 +25,7 @@ class Community extends FieldHolder
#[ORM\Column(type: 'uuid', unique: true)]
#[ORM\GeneratedValue(strategy: 'CUSTOM')]
#[ORM\CustomIdGenerator(class: 'doctrine.uuid_generator')]
#[Groups(['communities'])]
public ?Uuid $id = null;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ public function process(mixed $data, Operation $operation, array $uriVariables =
foreach ($wikidataIdFields as $wikidataId => $fields) {
$community = null;
try {
// var_dump($wikidataId);
$community = new Community();
$this->communityRepo->add($community);

Expand Down
2 changes: 2 additions & 0 deletions src/FieldHolder/Place/Domain/Model/Place.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Intl\Countries;
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Uid\Uuid;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
Expand All @@ -24,6 +25,7 @@ class Place extends FieldHolder
#[ORM\Column(type: 'uuid', unique: true)]
#[ORM\GeneratedValue(strategy: 'CUSTOM')]
#[ORM\CustomIdGenerator(class: 'doctrine.uuid_generator')]
#[Groups(['places'])]
public ?Uuid $id = null;

/**
Expand Down

0 comments on commit 5e7eed0

Please sign in to comment.