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

@@ -52,6 +52,7 @@ class Evaluation
private ?DateInterval $notificationDelay = null;
/**
* @var Collection<SocialAction>
* @ORM\ManyToMany(
* targetEntity=SocialAction::class,
* mappedBy="evaluations"

View File

@@ -43,12 +43,14 @@ class Goal
private ?int $id = null;
/**
* @var Collection<Result>
* @ORM\ManyToMany(targetEntity=Result::class, inversedBy="goals")
* @ORM\JoinTable(name="chill_person_social_work_goal_result")
*/
private Collection $results;
/**
* @var Collection<SocialAction>
* @ORM\ManyToMany(targetEntity=SocialAction::class, mappedBy="goals")
*/
private Collection $socialActions;

View File

@@ -33,11 +33,13 @@ use Symfony\Component\Serializer\Annotation as Serializer;
class Result
{
/**
* @var Collection<AccompanyingPeriodWorkGoal>
* @ORM\ManyToMany(targetEntity=AccompanyingPeriodWorkGoal::class, mappedBy="results")
*/
private Collection $accompanyingPeriodWorkGoals;
/**
* @var Collection<AccompanyingPeriodWork>
* @ORM\ManyToMany(targetEntity=AccompanyingPeriodWork::class, mappedBy="results")
*/
private Collection $accompanyingPeriodWorks;
@@ -48,6 +50,7 @@ class Result
private ?DateTime $desactivationDate = null;
/**
* @var Collection<Goal>
* @ORM\ManyToMany(targetEntity=Goal::class, mappedBy="results")
*/
private Collection $goals;
@@ -61,6 +64,7 @@ class Result
private ?int $id = null;
/**
* @var Collection<SocialAction>
* @ORM\ManyToMany(targetEntity=SocialAction::class, mappedBy="results")
*/
private Collection $socialActions;

View File

@@ -32,9 +32,10 @@ use Symfony\Component\Serializer\Annotation as Serializer;
class SocialAction
{
/**
* @var Collection<SocialAction>
* @ORM\OneToMany(targetEntity=SocialAction::class, mappedBy="parent")
*/
private $children;
private Collection $children;
/**
* @ORM\Column(type="dateinterval", nullable=true)
@@ -47,16 +48,18 @@ class SocialAction
private $desactivationDate;
/**
* @var Collection<Evaluation>
* @ORM\ManyToMany(targetEntity=Evaluation::class, inversedBy="socialActions")
* @ORM\JoinTable(name="chill_person_social_work_evaluation_action")
*/
private Collection $evaluations;
/**
* @var Collection<Goal>
* @ORM\ManyToMany(targetEntity=Goal::class, inversedBy="socialActions")
* @ORM\JoinTable(name="chill_person_social_action_goal")
*/
private $goals;
private Collection $goals;
/**
* @ORM\Id
@@ -81,10 +84,11 @@ class SocialAction
private $parent;
/**
* @var Collection<Result>
* @ORM\ManyToMany(targetEntity=Result::class, inversedBy="socialActions")
* @ORM\JoinTable(name="chill_person_social_action_result")
*/
private $results;
private Collection $results;
/**
* @ORM\Column(type="json")

View File

@@ -28,9 +28,10 @@ use Symfony\Component\Serializer\Annotation\Groups;
class SocialIssue
{
/**
* @var Collection<SocialIssue>
* @ORM\OneToMany(targetEntity=SocialIssue::class, mappedBy="parent")
*/
private $children;
private Collection $children;
/**
* @ORM\Column(type="datetime", nullable=true)
@@ -55,9 +56,10 @@ class SocialIssue
private $parent;
/**
* @var Collection<SocialAction>
* @ORM\OneToMany(targetEntity=SocialAction::class, mappedBy="issue")
*/
private $socialActions;
private Collection $socialActions;
/**
* @ORM\Column(type="json")