DX: type-hing oneToMany and ManyToMany properties as collection

This commit is contained in:
2023-07-19 16:21:17 +02:00
parent 224c2c74e8
commit 075aca493b
32 changed files with 130 additions and 73 deletions

View File

@@ -102,6 +102,7 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues
private ?DateTimeImmutable $endDate = null;
/**
* @var Collection<AccompanyingPeriodWorkGoal>
* @ORM\OneToMany(
* targetEntity=AccompanyingPeriodWorkGoal::class,
* mappedBy="accompanyingPeriodWork",
@@ -137,6 +138,7 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues
private string $note = '';
/**
* @var Collection<Person>
* @ORM\ManyToMany(targetEntity=Person::class)
* @ORM\JoinTable(name="chill_person_accompanying_period_work_person")
* @Serializer\Groups({"read", "docgen:read", "read:accompanyingPeriodWork:light"})
@@ -152,6 +154,7 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues
private PrivateCommentEmbeddable $privateComment;
/**
* @var Collection<User>
* @ORM\ManyToMany(targetEntity=User::class)
* @ORM\JoinTable(name="chill_person_accompanying_period_work_referrer")
* @Serializer\Groups({"read", "docgen:read", "read:accompanyingPeriodWork:light"})
@@ -161,6 +164,7 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues
private Collection $referrers;
/**
* @var Collection<Result>
* @ORM\ManyToMany(targetEntity=Result::class, inversedBy="accompanyingPeriodWorks")
* @ORM\JoinTable(name="chill_person_accompanying_period_work_result")
* @Serializer\Groups({"read", "docgen:read"})
@@ -185,6 +189,7 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues
private ?DateTimeImmutable $startDate = null;
/**
* @var Collection<ThirdParty>
* @ORM\ManyToMany(targetEntity=ThirdParty::class)
* @ORM\JoinTable(name="chill_person_accompanying_period_work_third_party")
*

View File

@@ -59,6 +59,7 @@ class AccompanyingPeriodWorkGoal
private ?string $note = null;
/**
* @var Collection<Result>
* @ORM\ManyToMany(targetEntity=Result::class, inversedBy="accompanyingPeriodWorkGoals")
* @ORM\JoinTable(name="chill_person_accompanying_period_work_goal_result")
* @Serializer\Groups({"accompanying_period_work:edit"})

View File

@@ -32,6 +32,7 @@ class ClosingMotive
/**
* Child Accompanying periods.
*
* @var Collection<ClosingMotive>
* @ORM\OneToMany(
* targetEntity="Chill\PersonBundle\Entity\AccompanyingPeriod\ClosingMotive",
* mappedBy="parent")