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

@@ -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")