DX: type-hing oneToMany and ManyToMany properties as collection

This commit is contained in:
Julien Fastré 2023-07-19 16:21:17 +02:00
parent 224c2c74e8
commit 075aca493b
Signed by: julienfastre
GPG Key ID: BDE2190974723FCB
32 changed files with 130 additions and 73 deletions

View File

@ -104,6 +104,7 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac
/** /**
* @ORM\ManyToMany(targetEntity="Chill\DocStoreBundle\Entity\StoredObject", cascade={"persist"}) * @ORM\ManyToMany(targetEntity="Chill\DocStoreBundle\Entity\StoredObject", cascade={"persist"})
* @Assert\Valid(traverse=true) * @Assert\Valid(traverse=true)
* @var Collection<StoredObject>
*/ */
private Collection $documents; private Collection $documents;
@ -140,8 +141,9 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac
/** /**
* @ORM\ManyToMany(targetEntity="Chill\PersonBundle\Entity\Person") * @ORM\ManyToMany(targetEntity="Chill\PersonBundle\Entity\Person")
* @Groups({"read", "docgen:read"}) * @Groups({"read", "docgen:read"})
* @var Collection<Person>
*/ */
private ?Collection $persons = null; private Collection $persons;
/** /**
* @ORM\Embedded(class="Chill\MainBundle\Entity\Embeddable\PrivateCommentEmbeddable", columnPrefix="privateComment_") * @ORM\Embedded(class="Chill\MainBundle\Entity\Embeddable\PrivateCommentEmbeddable", columnPrefix="privateComment_")
@ -151,6 +153,7 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac
/** /**
* @ORM\ManyToMany(targetEntity="Chill\ActivityBundle\Entity\ActivityReason") * @ORM\ManyToMany(targetEntity="Chill\ActivityBundle\Entity\ActivityReason")
* @Groups({"docgen:read"}) * @Groups({"docgen:read"})
* @var Collection<ActivityReason>
*/ */
private Collection $reasons; private Collection $reasons;
@ -170,6 +173,7 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac
* @ORM\ManyToMany(targetEntity="Chill\PersonBundle\Entity\SocialWork\SocialAction") * @ORM\ManyToMany(targetEntity="Chill\PersonBundle\Entity\SocialWork\SocialAction")
* @ORM\JoinTable(name="chill_activity_activity_chill_person_socialaction") * @ORM\JoinTable(name="chill_activity_activity_chill_person_socialaction")
* @Groups({"read", "docgen:read"}) * @Groups({"read", "docgen:read"})
* @var Collection<SocialAction>
*/ */
private Collection $socialActions; private Collection $socialActions;
@ -177,14 +181,16 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac
* @ORM\ManyToMany(targetEntity="Chill\PersonBundle\Entity\SocialWork\SocialIssue") * @ORM\ManyToMany(targetEntity="Chill\PersonBundle\Entity\SocialWork\SocialIssue")
* @ORM\JoinTable(name="chill_activity_activity_chill_person_socialissue") * @ORM\JoinTable(name="chill_activity_activity_chill_person_socialissue")
* @Groups({"read", "docgen:read"}) * @Groups({"read", "docgen:read"})
* @var Collection<SocialIssue>
*/ */
private Collection $socialIssues; private Collection $socialIssues;
/** /**
* @ORM\ManyToMany(targetEntity="Chill\ThirdPartyBundle\Entity\ThirdParty") * @ORM\ManyToMany(targetEntity="Chill\ThirdPartyBundle\Entity\ThirdParty")
* @Groups({"read", "docgen:read"}) * @Groups({"read", "docgen:read"})
* @var Collection<ThirdParty>
*/ */
private ?Collection $thirdParties = null; private Collection $thirdParties;
/** /**
* @ORM\Column(type="time", nullable=true) * @ORM\Column(type="time", nullable=true)
@ -200,8 +206,9 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac
/** /**
* @ORM\ManyToMany(targetEntity="Chill\MainBundle\Entity\User") * @ORM\ManyToMany(targetEntity="Chill\MainBundle\Entity\User")
* @Groups({"read", "docgen:read"}) * @Groups({"read", "docgen:read"})
* @var Collection<User>
*/ */
private ?Collection $users = null; private Collection $users;
public function __construct() public function __construct()
{ {

View File

@ -12,6 +12,7 @@ declare(strict_types=1);
namespace Chill\ActivityBundle\Entity; namespace Chill\ActivityBundle\Entity;
use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
/** /**
@ -47,12 +48,12 @@ class ActivityReasonCategory implements \Stringable
/** /**
* Array of ActivityReason. * Array of ActivityReason.
* *
* @var ArrayCollection * @var Collection<ActivityReason>
* @ORM\OneToMany( * @ORM\OneToMany(
* targetEntity="Chill\ActivityBundle\Entity\ActivityReason", * targetEntity="Chill\ActivityBundle\Entity\ActivityReason",
* mappedBy="category") * mappedBy="category")
*/ */
private $reasons; private Collection $reasons;
/** /**
* ActivityReasonCategory constructor. * ActivityReasonCategory constructor.

View File

@ -25,8 +25,9 @@ class AsideActivityCategory
{ {
/** /**
* @ORM\OneToMany(targetEntity=AsideActivityCategory::class, mappedBy="parent") * @ORM\OneToMany(targetEntity=AsideActivityCategory::class, mappedBy="parent")
* @var Collection<AsideActivityCategory>
*/ */
private $children; private Collection $children;
/** /**
* @ORM\Id * @ORM\Id
@ -36,7 +37,6 @@ class AsideActivityCategory
private int $id; private int $id;
/** /**
* @ORM\OneToMany(targetEntity=AsideActivityCategory::class, mappedBy="parent")
* @ORM\Column(type="boolean") * @ORM\Column(type="boolean")
*/ */
private bool $isActive = true; private bool $isActive = true;

View File

@ -30,6 +30,7 @@ use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection; use Doctrine\Common\Collections\Collection;
use Doctrine\Common\Collections\Criteria; use Doctrine\Common\Collections\Criteria;
use Doctrine\Common\Collections\ReadableCollection; use Doctrine\Common\Collections\ReadableCollection;
use Doctrine\Common\Collections\Selectable;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use LogicException; use LogicException;
use Symfony\Component\Serializer\Annotation as Serializer; use Symfony\Component\Serializer\Annotation as Serializer;
@ -125,7 +126,7 @@ class Calendar implements TrackCreationInterface, TrackUpdateInterface, HasCente
private int $dateTimeVersion = 0; private int $dateTimeVersion = 0;
/** /**
* @var Collection<CalendarDoc::class> * @var Collection<CalendarDoc>
* @ORM\OneToMany(targetEntity=CalendarDoc::class, mappedBy="calendar", orphanRemoval=true) * @ORM\OneToMany(targetEntity=CalendarDoc::class, mappedBy="calendar", orphanRemoval=true)
*/ */
private Collection $documents; private Collection $documents;
@ -154,8 +155,9 @@ class Calendar implements TrackCreationInterface, TrackUpdateInterface, HasCente
* ) * )
* @ORM\JoinTable(name="chill_calendar.calendar_to_invites") * @ORM\JoinTable(name="chill_calendar.calendar_to_invites")
* @Serializer\Groups({"read", "docgen:read"}) * @Serializer\Groups({"read", "docgen:read"})
* @var Collection&Selectable<int, Invite>
*/ */
private Collection $invites; private Collection&Selectable $invites;
/** /**
* @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\Location") * @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\Location")
@ -184,6 +186,7 @@ class Calendar implements TrackCreationInterface, TrackUpdateInterface, HasCente
* @Serializer\Groups({"calendar:read", "read", "calendar:light", "docgen:read"}) * @Serializer\Groups({"calendar:read", "read", "calendar:light", "docgen:read"})
* @Serializer\Context(normalizationContext={"read"}, groups={"calendar:light"}) * @Serializer\Context(normalizationContext={"read"}, groups={"calendar:light"})
* @Assert\Count(min=1, minMessage="calendar.At least {{ limit }} person is required.") * @Assert\Count(min=1, minMessage="calendar.At least {{ limit }} person is required.")
* @var Collection<Person>
*/ */
private Collection $persons; private Collection $persons;
@ -194,6 +197,7 @@ class Calendar implements TrackCreationInterface, TrackUpdateInterface, HasCente
private PrivateCommentEmbeddable $privateComment; private PrivateCommentEmbeddable $privateComment;
/** /**
* @var Collection<ThirdParty>
* @ORM\ManyToMany(targetEntity="Chill\ThirdPartyBundle\Entity\ThirdParty") * @ORM\ManyToMany(targetEntity="Chill\ThirdPartyBundle\Entity\ThirdParty")
* @ORM\JoinTable(name="chill_calendar.calendar_to_thirdparties") * @ORM\JoinTable(name="chill_calendar.calendar_to_thirdparties")
* @Serializer\Groups({"calendar:read", "read", "calendar:light", "docgen:read"}) * @Serializer\Groups({"calendar:read", "read", "calendar:light", "docgen:read"})

View File

@ -28,12 +28,12 @@ class Option
private $active = true; private $active = true;
/** /**
* @var Collection * @var Collection<Option>
* @ORM\OneToMany( * @ORM\OneToMany(
* targetEntity="Chill\CustomFieldsBundle\Entity\CustomFieldLongChoice\Option", * targetEntity="Chill\CustomFieldsBundle\Entity\CustomFieldLongChoice\Option",
* mappedBy="parent") * mappedBy="parent")
*/ */
private $children; private Collection $children;
/** /**
* @var int * @var int

View File

@ -35,14 +35,13 @@ class CustomFieldsGroup
* The custom fields of the group. * The custom fields of the group.
* The custom fields are asc-ordered regarding to their property "ordering". * The custom fields are asc-ordered regarding to their property "ordering".
* *
* @var Collection * @var Collection<CustomField>
*
* @ORM\OneToMany( * @ORM\OneToMany(
* targetEntity="Chill\CustomFieldsBundle\Entity\CustomField", * targetEntity="Chill\CustomFieldsBundle\Entity\CustomField",
* mappedBy="customFieldGroup") * mappedBy="customFieldGroup")
* @ORM\OrderBy({"ordering": "ASC"}) * @ORM\OrderBy({"ordering": "ASC"})
*/ */
private $customFields; private Collection $customFields;
/** /**
* @var string * @var string

View File

@ -72,12 +72,12 @@ class Event implements HasCenterInterface, HasScopeInterface
private $name; private $name;
/** /**
* @var Participation * @var Collection<Participation>
* @ORM\OneToMany( * @ORM\OneToMany(
* targetEntity="Chill\EventBundle\Entity\Participation", * targetEntity="Chill\EventBundle\Entity\Participation",
* mappedBy="event") * mappedBy="event")
*/ */
private $participations; private Collection $participations;
/** /**
* @var EventType * @var EventType
@ -174,11 +174,11 @@ class Event implements HasCenterInterface, HasScopeInterface
*/ */
public function getParticipationsOrdered(): \ArrayIterator|\Traversable public function getParticipationsOrdered(): \ArrayIterator|\Traversable
{ {
$iterator = $this->participations->getIterator(); $iterator = iterator_to_array($this->participations->getIterator());
$iterator->uasort(static fn ($first, $second) => strnatcasecmp($first->getPerson()->getFirstName(), $second->getPerson()->getFirstName())); uasort($iterator, static fn ($first, $second) => strnatcasecmp($first->getPerson()->getFirstName(), $second->getPerson()->getFirstName()));
return $iterator; return new ArrayIterator($iterator);
} }
/** /**

View File

@ -46,20 +46,20 @@ class EventType
private $name; private $name;
/** /**
* @var Collection * @var Collection<Role>
* @ORM\OneToMany( * @ORM\OneToMany(
* targetEntity="Chill\EventBundle\Entity\Role", * targetEntity="Chill\EventBundle\Entity\Role",
* mappedBy="type") * mappedBy="type")
*/ */
private $roles; private Collection $roles;
/** /**
* @var Collection * @var Collection<Status>
* @ORM\OneToMany( * @ORM\OneToMany(
* targetEntity="Chill\EventBundle\Entity\Status", * targetEntity="Chill\EventBundle\Entity\Status",
* mappedBy="type") * mappedBy="type")
*/ */
private $statuses; private Collection $statuses;
/** /**
* Constructor. * Constructor.

View File

@ -110,7 +110,7 @@ class Address implements TrackCreationInterface, TrackUpdateInterface
* This list is computed by a materialized view. It won't be populated until a refresh is done * This list is computed by a materialized view. It won't be populated until a refresh is done
* on the materialized view. * on the materialized view.
* *
* @var Collection<int, GeographicalUnit>|GeographicalUnit[] * @var Collection<GeographicalUnit>
* @readonly * @readonly
* @ORM\ManyToMany(targetEntity=GeographicalUnit::class) * @ORM\ManyToMany(targetEntity=GeographicalUnit::class)
* @ORM\JoinTable( * @ORM\JoinTable(

View File

@ -23,14 +23,14 @@ use Symfony\Component\Serializer\Annotation as Serializer;
class Center implements HasCenterInterface, \Stringable class Center implements HasCenterInterface, \Stringable
{ {
/** /**
* @var Collection * @var Collection<GroupCenter>
* *
* @ORM\OneToMany( * @ORM\OneToMany(
* targetEntity="Chill\MainBundle\Entity\GroupCenter", * targetEntity="Chill\MainBundle\Entity\GroupCenter",
* mappedBy="center" * mappedBy="center"
* ) * )
*/ */
private $groupCenters; private Collection $groupCenters;
/** /**
* @var int * @var int

View File

@ -45,6 +45,7 @@ class GeographicalUnitLayer
private string $refId = ''; private string $refId = '';
/** /**
* @var Collection<GeographicalUnit>
* @ORM\OneToMany(targetEntity=GeographicalUnit::class, mappedBy="layer") * @ORM\OneToMany(targetEntity=GeographicalUnit::class, mappedBy="layer")
*/ */
private Collection $units; private Collection $units;

View File

@ -42,6 +42,7 @@ class Notification implements TrackUpdateInterface
private array $addedAddresses = []; private array $addedAddresses = [];
/** /**
* @var Collection<User>
* @ORM\ManyToMany(targetEntity=User::class) * @ORM\ManyToMany(targetEntity=User::class)
* @ORM\JoinTable(name="chill_main_notification_addresses_user") * @ORM\JoinTable(name="chill_main_notification_addresses_user")
*/ */
@ -65,6 +66,7 @@ class Notification implements TrackUpdateInterface
private ?ArrayCollection $addressesOnLoad = null; private ?ArrayCollection $addressesOnLoad = null;
/** /**
* @var Collection<NotificationComment>
* @ORM\OneToMany(targetEntity=NotificationComment::class, mappedBy="notification", orphanRemoval=true) * @ORM\OneToMany(targetEntity=NotificationComment::class, mappedBy="notification", orphanRemoval=true)
* @ORM\OrderBy({"createdAt": "ASC"}) * @ORM\OrderBy({"createdAt": "ASC"})
*/ */
@ -112,6 +114,7 @@ class Notification implements TrackUpdateInterface
private string $title = ''; private string $title = '';
/** /**
* @var Collection<User>
* @ORM\ManyToMany(targetEntity=User::class) * @ORM\ManyToMany(targetEntity=User::class)
* @ORM\JoinTable(name="chill_main_notification_addresses_unread") * @ORM\JoinTable(name="chill_main_notification_addresses_unread")
*/ */

View File

@ -32,14 +32,13 @@ class PermissionsGroup
private $flags = []; private $flags = [];
/** /**
* @var Collection * @var Collection<GroupCenter>
*
* @ORM\OneToMany( * @ORM\OneToMany(
* targetEntity="Chill\MainBundle\Entity\GroupCenter", * targetEntity="Chill\MainBundle\Entity\GroupCenter",
* mappedBy="permissionsGroup" * mappedBy="permissionsGroup"
* ) * )
*/ */
private $groupCenters; private Collection $groupCenters;
/** /**
* @var int * @var int
@ -58,15 +57,14 @@ class PermissionsGroup
private $name; private $name;
/** /**
* @var Collection * @var Collection<RoleScope>
*
* @ORM\ManyToMany( * @ORM\ManyToMany(
* targetEntity="Chill\MainBundle\Entity\RoleScope", * targetEntity="Chill\MainBundle\Entity\RoleScope",
* inversedBy="permissionsGroups", * inversedBy="permissionsGroups",
* cascade={ "persist" }) * cascade={ "persist" })
* @ORM\Cache(usage="NONSTRICT_READ_WRITE") * @ORM\Cache(usage="NONSTRICT_READ_WRITE")
*/ */
private $roleScopes; private Collection $roleScopes;
/** /**
* PermissionsGroup constructor. * PermissionsGroup constructor.

View File

@ -30,13 +30,13 @@ class RoleScope
private ?int $id = null; private ?int $id = null;
/** /**
* @var Collection * @var Collection<PermissionsGroup>
* *
* @ORM\ManyToMany( * @ORM\ManyToMany(
* targetEntity="Chill\MainBundle\Entity\PermissionsGroup", * targetEntity="Chill\MainBundle\Entity\PermissionsGroup",
* mappedBy="roleScopes") * mappedBy="roleScopes")
*/ */
private $permissionsGroups; private Collection $permissionsGroups;
/** /**
* @ORM\Column(type="string", length=255) * @ORM\Column(type="string", length=255)

View File

@ -51,14 +51,14 @@ class Scope
private array $name = []; private array $name = [];
/** /**
* @var Collection * @var Collection<RoleScope>
* *
* @ORM\OneToMany( * @ORM\OneToMany(
* targetEntity="Chill\MainBundle\Entity\RoleScope", * targetEntity="Chill\MainBundle\Entity\RoleScope",
* mappedBy="scope") * mappedBy="scope")
* @ORM\Cache(usage="NONSTRICT_READ_WRITE") * @ORM\Cache(usage="NONSTRICT_READ_WRITE")
*/ */
private $roleScopes; private Collection $roleScopes;
/** /**
* Scope constructor. * Scope constructor.

View File

@ -83,6 +83,7 @@ class User implements UserInterface, \Stringable
private bool $enabled = true; private bool $enabled = true;
/** /**
* @var Collection<GroupCenter>
* @ORM\ManyToMany( * @ORM\ManyToMany(
* targetEntity="Chill\MainBundle\Entity\GroupCenter", * targetEntity="Chill\MainBundle\Entity\GroupCenter",
* inversedBy="users") * inversedBy="users")

View File

@ -75,7 +75,7 @@ class EntityWorkflow implements TrackCreationInterface, TrackUpdateInterface
/** /**
* @ORM\OneToMany(targetEntity=EntityWorkflowComment::class, mappedBy="entityWorkflow", orphanRemoval=true) * @ORM\OneToMany(targetEntity=EntityWorkflowComment::class, mappedBy="entityWorkflow", orphanRemoval=true)
* *
* @var Collection|EntityWorkflowComment[] * @var Collection<EntityWorkflowComment>
*/ */
private Collection $comments; private Collection $comments;
@ -100,7 +100,7 @@ class EntityWorkflow implements TrackCreationInterface, TrackUpdateInterface
* @ORM\OneToMany(targetEntity=EntityWorkflowStep::class, mappedBy="entityWorkflow", orphanRemoval=true, cascade={"persist"}) * @ORM\OneToMany(targetEntity=EntityWorkflowStep::class, mappedBy="entityWorkflow", orphanRemoval=true, cascade={"persist"})
* @ORM\OrderBy({"transitionAt": "ASC", "id": "ASC"}) * @ORM\OrderBy({"transitionAt": "ASC", "id": "ASC"})
* @Assert\Valid(traverse=true) * @Assert\Valid(traverse=true)
* @var Collection|EntityWorkflowStep[] * @var Collection<EntityWorkflowStep>
*/ */
private Collection $steps; private Collection $steps;
@ -113,7 +113,7 @@ class EntityWorkflow implements TrackCreationInterface, TrackUpdateInterface
* @ORM\ManyToMany(targetEntity=User::class) * @ORM\ManyToMany(targetEntity=User::class)
* @ORM\JoinTable(name="chill_main_workflow_entity_subscriber_to_final") * @ORM\JoinTable(name="chill_main_workflow_entity_subscriber_to_final")
* *
* @var Collection|User[] * @var Collection<User>
*/ */
private Collection $subscriberToFinal; private Collection $subscriberToFinal;
@ -121,7 +121,7 @@ class EntityWorkflow implements TrackCreationInterface, TrackUpdateInterface
* @ORM\ManyToMany(targetEntity=User::class) * @ORM\ManyToMany(targetEntity=User::class)
* @ORM\JoinTable(name="chill_main_workflow_entity_subscriber_to_step") * @ORM\JoinTable(name="chill_main_workflow_entity_subscriber_to_step")
* *
* @var Collection|User[] * @var Collection<User>
*/ */
private Collection $subscriberToStep; private Collection $subscriberToStep;

View File

@ -33,6 +33,7 @@ class EntityWorkflowStep
private string $accessKey; private string $accessKey;
/** /**
* @var Collection<User>
* @ORM\ManyToMany(targetEntity=User::class) * @ORM\ManyToMany(targetEntity=User::class)
* @ORM\JoinTable(name="chill_main_workflow_entity_step_cc_user") * @ORM\JoinTable(name="chill_main_workflow_entity_step_cc_user")
*/ */
@ -54,12 +55,14 @@ class EntityWorkflowStep
private array $destEmail = []; private array $destEmail = [];
/** /**
* @var Collection<User>
* @ORM\ManyToMany(targetEntity=User::class) * @ORM\ManyToMany(targetEntity=User::class)
* @ORM\JoinTable(name="chill_main_workflow_entity_step_user") * @ORM\JoinTable(name="chill_main_workflow_entity_step_user")
*/ */
private Collection $destUser; private Collection $destUser;
/** /**
* @var Collection<User>
* @ORM\ManyToMany(targetEntity=User::class) * @ORM\ManyToMany(targetEntity=User::class)
* @ORM\JoinTable(name="chill_main_workflow_entity_step_user_by_accesskey") * @ORM\JoinTable(name="chill_main_workflow_entity_step_user_by_accesskey")
*/ */

View File

@ -11,6 +11,7 @@ declare(strict_types=1);
namespace Chill\PersonBundle\Entity; namespace Chill\PersonBundle\Entity;
use Chill\CalendarBundle\Entity\Calendar;
use Chill\MainBundle\Doctrine\Model\TrackCreationInterface; use Chill\MainBundle\Doctrine\Model\TrackCreationInterface;
use Chill\MainBundle\Doctrine\Model\TrackUpdateInterface; use Chill\MainBundle\Doctrine\Model\TrackUpdateInterface;
use Chill\MainBundle\Entity\Address; use Chill\MainBundle\Entity\Address;
@ -43,6 +44,7 @@ use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection; use Doctrine\Common\Collections\Collection;
use Doctrine\Common\Collections\Criteria; use Doctrine\Common\Collections\Criteria;
use Doctrine\Common\Collections\ReadableCollection; use Doctrine\Common\Collections\ReadableCollection;
use Doctrine\Common\Collections\Selectable;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Iterator; use Iterator;
use LogicException; use LogicException;
@ -150,13 +152,12 @@ class AccompanyingPeriod implements
private ?Location $administrativeLocation = null; private ?Location $administrativeLocation = null;
/** /**
* @var Collection&Selectable<int, Calendar>
* @ORM\OneToMany(targetEntity="Chill\CalendarBundle\Entity\Calendar", mappedBy="accompanyingPeriod") * @ORM\OneToMany(targetEntity="Chill\CalendarBundle\Entity\Calendar", mappedBy="accompanyingPeriod")
*/ */
private Collection $calendars; private Collection&Selectable $calendars;
/** /**
* @var DateTime
*
* @ORM\Column(type="date", nullable=true) * @ORM\Column(type="date", nullable=true)
* @Groups({"read", "write", "docgen:read"}) * @Groups({"read", "write", "docgen:read"})
* @Assert\NotBlank(groups={AccompanyingPeriod::STEP_CLOSED}) * @Assert\NotBlank(groups={AccompanyingPeriod::STEP_CLOSED})
@ -242,6 +243,7 @@ class AccompanyingPeriod implements
private ?UserJob $job = null; private ?UserJob $job = null;
/** /**
* @var Collection<AccompanyingPeriodLocationHistory>
* @ORM\OneToMany(targetEntity=AccompanyingPeriodLocationHistory::class, * @ORM\OneToMany(targetEntity=AccompanyingPeriodLocationHistory::class,
* mappedBy="period", cascade={"persist", "remove"}, orphanRemoval=true) * mappedBy="period", cascade={"persist", "remove"}, orphanRemoval=true)
*/ */
@ -320,6 +322,7 @@ class AccompanyingPeriod implements
private ?ThirdParty $requestorThirdParty = null; private ?ThirdParty $requestorThirdParty = null;
/** /**
* @var Collection<Resource>
* @ORM\OneToMany( * @ORM\OneToMany(
* targetEntity="Chill\PersonBundle\Entity\AccompanyingPeriod\Resource", * targetEntity="Chill\PersonBundle\Entity\AccompanyingPeriod\Resource",
* mappedBy="accompanyingPeriod", * mappedBy="accompanyingPeriod",
@ -332,6 +335,7 @@ class AccompanyingPeriod implements
private Collection $resources; private Collection $resources;
/** /**
* @var Collection<Scope>
* @ORM\ManyToMany( * @ORM\ManyToMany(
* targetEntity=Scope::class, * targetEntity=Scope::class,
* cascade={} * cascade={}
@ -347,6 +351,7 @@ class AccompanyingPeriod implements
private Collection $scopes; private Collection $scopes;
/** /**
* @var Collection<SocialIssue>
* @ORM\ManyToMany( * @ORM\ManyToMany(
* targetEntity=SocialIssue::class * targetEntity=SocialIssue::class
* ) * )
@ -366,6 +371,7 @@ class AccompanyingPeriod implements
private string $step = self::STEP_DRAFT; private string $step = self::STEP_DRAFT;
/** /**
* @var Collection<AccompanyingPeriodStepHistory>
* @ORM\OneToMany(targetEntity=AccompanyingPeriodStepHistory::class, * @ORM\OneToMany(targetEntity=AccompanyingPeriodStepHistory::class,
* mappedBy="period", cascade={"persist", "remove"}, orphanRemoval=true) * mappedBy="period", cascade={"persist", "remove"}, orphanRemoval=true)
*/ */
@ -394,7 +400,7 @@ class AccompanyingPeriod implements
* @ORM\OneToMany(targetEntity=UserHistory::class, mappedBy="accompanyingPeriod", orphanRemoval=true, * @ORM\OneToMany(targetEntity=UserHistory::class, mappedBy="accompanyingPeriod", orphanRemoval=true,
* cascade={"persist", "remove"}) * cascade={"persist", "remove"})
* *
* @var Collection|UserHistory[] * @var Collection<UserHistory>
*/ */
private Collection $userHistories; private Collection $userHistories;
@ -408,6 +414,7 @@ class AccompanyingPeriod implements
private ?User $userPrevious = null; private ?User $userPrevious = null;
/** /**
* @var Collection<AccompanyingPeriodWork>
* @ORM\OneToMany( * @ORM\OneToMany(
* targetEntity=AccompanyingPeriodWork::class, * targetEntity=AccompanyingPeriodWork::class,
* mappedBy="accompanyingPeriod" * mappedBy="accompanyingPeriod"
@ -812,7 +819,7 @@ class AccompanyingPeriod implements
return 'none'; return 'none';
} }
public function getNextCalendarsForPerson(Person $person, $limit = 5): Collection public function getNextCalendarsForPerson(Person $person, $limit = 5): ReadableCollection
{ {
$today = new DateTimeImmutable('today'); $today = new DateTimeImmutable('today');
$criteria = Criteria::create() $criteria = Criteria::create()

View File

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

View File

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

View File

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

View File

@ -23,6 +23,7 @@ use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection; use Doctrine\Common\Collections\Collection;
use Doctrine\Common\Collections\Criteria; use Doctrine\Common\Collections\Criteria;
use Doctrine\Common\Collections\ReadableCollection; use Doctrine\Common\Collections\ReadableCollection;
use Doctrine\Common\Collections\Selectable;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation as Serializer; use Symfony\Component\Serializer\Annotation as Serializer;
use Symfony\Component\Validator\Constraints as Assert; use Symfony\Component\Validator\Constraints as Assert;
@ -45,6 +46,7 @@ class Household
/** /**
* Addresses. * Addresses.
* *
* @var Collection<Address>
* @ORM\ManyToMany( * @ORM\ManyToMany(
* targetEntity="Chill\MainBundle\Entity\Address", * targetEntity="Chill\MainBundle\Entity\Address",
* cascade={"persist", "remove", "merge", "detach"}) * cascade={"persist", "remove", "merge", "detach"})
@ -60,6 +62,7 @@ class Household
private CommentEmbeddable $commentMembers; private CommentEmbeddable $commentMembers;
/** /**
* @var Collection&Selectable<int, HouseholdComposition>
* @ORM\OneToMany( * @ORM\OneToMany(
* targetEntity=HouseholdComposition::class, * targetEntity=HouseholdComposition::class,
* mappedBy="household", * mappedBy="household",
@ -69,7 +72,7 @@ class Household
* @ORM\OrderBy({"startDate": "DESC"}) * @ORM\OrderBy({"startDate": "DESC"})
* @Assert\Valid(traverse=true, groups={"household_composition"}) * @Assert\Valid(traverse=true, groups={"household_composition"})
*/ */
private Collection $compositions; private Collection&Selectable $compositions;
/** /**
* @ORM\Id * @ORM\Id
@ -80,6 +83,7 @@ class Household
private ?int $id = null; private ?int $id = null;
/** /**
* @var Collection<HouseholdMember>
* @ORM\OneToMany( * @ORM\OneToMany(
* targetEntity=HouseholdMember::class, * targetEntity=HouseholdMember::class,
* mappedBy="household" * mappedBy="household"
@ -146,9 +150,9 @@ class Household
* *
* @Assert\Callback(methods={"validate"}) * @Assert\Callback(methods={"validate"})
* *
* @return \Chill\MainBundle\Entity\Address[] * @return Collection<Address>
*/ */
public function getAddresses() public function getAddresses(): Collection
{ {
return $this->addresses; return $this->addresses;
} }

View File

@ -14,6 +14,7 @@ namespace Chill\PersonBundle\Entity;
use ArrayIterator; use ArrayIterator;
use Chill\BudgetBundle\Entity\Charge; use Chill\BudgetBundle\Entity\Charge;
use Chill\BudgetBundle\Entity\Resource; use Chill\BudgetBundle\Entity\Resource;
use Chill\CalendarBundle\Entity\Calendar;
use Chill\MainBundle\Doctrine\Model\TrackCreationInterface; use Chill\MainBundle\Doctrine\Model\TrackCreationInterface;
use Chill\MainBundle\Doctrine\Model\TrackUpdateInterface; use Chill\MainBundle\Doctrine\Model\TrackUpdateInterface;
use Chill\MainBundle\Entity\Address; use Chill\MainBundle\Entity\Address;
@ -22,6 +23,7 @@ use Chill\MainBundle\Entity\Civility;
use Chill\MainBundle\Entity\Country; use Chill\MainBundle\Entity\Country;
use Chill\MainBundle\Entity\Embeddable\CommentEmbeddable; use Chill\MainBundle\Entity\Embeddable\CommentEmbeddable;
use Chill\MainBundle\Entity\HasCenterInterface; use Chill\MainBundle\Entity\HasCenterInterface;
use Chill\MainBundle\Entity\Language;
use Chill\MainBundle\Entity\User; use Chill\MainBundle\Entity\User;
use Chill\MainBundle\Validation\Constraint\PhonenumberConstraint; use Chill\MainBundle\Validation\Constraint\PhonenumberConstraint;
use Chill\PersonBundle\Entity\Household\Household; use Chill\PersonBundle\Entity\Household\Household;
@ -110,14 +112,14 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
/** /**
* The person's accompanying periods (when the person was accompanied by the center). * The person's accompanying periods (when the person was accompanied by the center).
* *
* @var Collection * @var Collection<AccompanyingPeriodParticipation>
* *
* @ORM\OneToMany(targetEntity=AccompanyingPeriodParticipation::class, * @ORM\OneToMany(targetEntity=AccompanyingPeriodParticipation::class,
* mappedBy="person", * mappedBy="person",
* cascade={"persist", "remove", "merge", "detach"}) * cascade={"persist", "remove", "merge", "detach"})
* @ORM\OrderBy({"startDate": "DESC"}) * @ORM\OrderBy({"startDate": "DESC"})
*/ */
private $accompanyingPeriodParticipations; private Collection $accompanyingPeriodParticipations;
/** /**
* The accompanying period requested by the Person. * The accompanying period requested by the Person.
@ -125,14 +127,14 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
* @ORM\OneToMany(targetEntity=AccompanyingPeriod::class, * @ORM\OneToMany(targetEntity=AccompanyingPeriod::class,
* mappedBy="requestorPerson") * mappedBy="requestorPerson")
* *
* @var AccompanyingPeriod[]|Collection * @var Collection<AccompanyingPeriod>
*/ */
private Collection $accompanyingPeriodRequested; private Collection $accompanyingPeriodRequested;
/** /**
* Addresses. * Addresses.
* *
* @var Collection * @var Collection<Address>
* *
* @ORM\ManyToMany( * @ORM\ManyToMany(
* targetEntity="Chill\MainBundle\Entity\Address", * targetEntity="Chill\MainBundle\Entity\Address",
@ -140,10 +142,10 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
* @ORM\JoinTable(name="chill_person_persons_to_addresses") * @ORM\JoinTable(name="chill_person_persons_to_addresses")
* @ORM\OrderBy({"validFrom": "DESC"}) * @ORM\OrderBy({"validFrom": "DESC"})
*/ */
private $addresses; private Collection $addresses;
/** /**
* @var Collection * @var Collection<PersonAltName>
* *
* @ORM\OneToMany( * @ORM\OneToMany(
* targetEntity="Chill\PersonBundle\Entity\PersonAltName", * targetEntity="Chill\PersonBundle\Entity\PersonAltName",
@ -151,7 +153,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
* cascade={"persist", "remove", "merge", "detach"}, * cascade={"persist", "remove", "merge", "detach"},
* orphanRemoval=true) * orphanRemoval=true)
*/ */
private $altNames; private Collection $altNames;
/** /**
* The person's birthdate. * The person's birthdate.
@ -164,6 +166,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
private $birthdate; private $birthdate;
/** /**
* @var Collection<Charge>
* @ORM\OneToMany( * @ORM\OneToMany(
* targetEntity=Charge::class, * targetEntity=Charge::class,
* mappedBy="person" * mappedBy="person"
@ -172,6 +175,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
private Collection $budgetCharges; private Collection $budgetCharges;
/** /**
* @var Collection<Resource>
* @ORM\OneToMany( * @ORM\OneToMany(
* targetEntity=Resource::class, * targetEntity=Resource::class,
* mappedBy="person" * mappedBy="person"
@ -180,6 +184,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
private Collection $budgetResources; private Collection $budgetResources;
/** /**
* @var Collection<Calendar>
* @ORM\ManyToMany( * @ORM\ManyToMany(
* targetEntity="Chill\CalendarBundle\Entity\Calendar", * targetEntity="Chill\CalendarBundle\Entity\Calendar",
* mappedBy="persons" * mappedBy="persons"
@ -204,7 +209,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
/** /**
* @ORM\OneToMany(targetEntity=PersonCenterHistory::class, mappedBy="person", cascade={"persist"}) * @ORM\OneToMany(targetEntity=PersonCenterHistory::class, mappedBy="person", cascade={"persist"})
* *
* @var Collection|PersonCenterHistory[] * @var Collection<PersonCenterHistory>
*/ */
private Collection $centerHistory; private Collection $centerHistory;
@ -342,6 +347,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
/** /**
* Read-only field, computed by the database. * Read-only field, computed by the database.
* *
* @var Collection<PersonHouseholdAddress>
* @ORM\OneToMany( * @ORM\OneToMany(
* targetEntity=PersonHouseholdAddress::class, * targetEntity=PersonHouseholdAddress::class,
* mappedBy="person" * mappedBy="person"
@ -355,7 +361,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
* mappedBy="person" * mappedBy="person"
* ) * )
* *
* @var Collection|HouseholdMember[] * @var Collection<HouseholdMember>
*/ */
private Collection $householdParticipations; private Collection $householdParticipations;
@ -446,7 +452,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
private ?int $numberOfChildren = null; private ?int $numberOfChildren = null;
/** /**
* @var Collection * @var Collection<PersonPhone>
* *
* @ORM\OneToMany( * @ORM\OneToMany(
* targetEntity="Chill\PersonBundle\Entity\PersonPhone", * targetEntity="Chill\PersonBundle\Entity\PersonPhone",
@ -458,13 +464,14 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
* traverse=true, * traverse=true,
* ) * )
*/ */
private $otherPhoneNumbers; private Collection $otherPhoneNumbers;
/** /**
* @ORM\OneToMany( * @ORM\OneToMany(
* targetEntity=AccompanyingPeriod::class, * targetEntity=AccompanyingPeriod::class,
* mappedBy="personLocation" * mappedBy="personLocation"
* ) * )
* @var Collection<AccompanyingPeriod>
*/ */
private Collection $periodLocatedOn; private Collection $periodLocatedOn;
@ -499,14 +506,14 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
/** /**
* @ORM\OneToMany(targetEntity=PersonResource::class, mappedBy="personOwner") * @ORM\OneToMany(targetEntity=PersonResource::class, mappedBy="personOwner")
* *
* @var Collection|PersonResource[]; * @var Collection<PersonResource>
*/ */
private Collection $resources; private Collection $resources;
/** /**
* The person's spoken languages. * The person's spoken languages.
* *
* @var ArrayCollection * @var Collection<Language>
* *
* @ORM\ManyToMany(targetEntity="Chill\MainBundle\Entity\Language") * @ORM\ManyToMany(targetEntity="Chill\MainBundle\Entity\Language")
* @ORM\JoinTable( * @ORM\JoinTable(
@ -515,7 +522,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
* inverseJoinColumns={@ORM\JoinColumn(name="language_id", referencedColumnName="id")} * inverseJoinColumns={@ORM\JoinColumn(name="language_id", referencedColumnName="id")}
* ) * )
*/ */
private $spokenLanguages; private Collection $spokenLanguages;
/** /**
* @ORM\Column(type="datetime", nullable=true, options={"default": NULL}) * @ORM\Column(type="datetime", nullable=true, options={"default": NULL})
@ -1361,7 +1368,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
/** /**
* Get spokenLanguages. * Get spokenLanguages.
* *
* @return ArrayCollection * @return Collection<Language>
*/ */
public function getSpokenLanguages() public function getSpokenLanguages()
{ {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -69,7 +69,7 @@ class RecurringTask extends AbstractTask
private $occurenceWarningInterval; private $occurenceWarningInterval;
/** /**
* @var Collection * @var Collection<SingleTask>
* *
* @ORM\OneToMany( * @ORM\OneToMany(
* targetEntity="SingleTask", * targetEntity="SingleTask",

View File

@ -11,6 +11,7 @@ declare(strict_types=1);
namespace Chill\TaskBundle\Entity; namespace Chill\TaskBundle\Entity;
use Chill\TaskBundle\Entity\Task\SingleTaskPlaceEvent;
use DateInterval; use DateInterval;
use DateTime; use DateTime;
use DateTimeImmutable; use DateTimeImmutable;
@ -92,14 +93,14 @@ class SingleTask extends AbstractTask
private $startDate; private $startDate;
/** /**
* @var \Doctrine\Common\Collections\Collection * @var Collection<SingleTaskPlaceEvent>
* @ORM\OneToMany( * @ORM\OneToMany(
* targetEntity="\Chill\TaskBundle\Entity\Task\SingleTaskPlaceEvent", * targetEntity="\Chill\TaskBundle\Entity\Task\SingleTaskPlaceEvent",
* mappedBy="task", * mappedBy="task",
* cascade={ "remove" } * cascade={ "remove" }
* ) * )
*/ */
private $taskPlaceEvents; private Collection $taskPlaceEvents;
/** /**
* @var DateInterval * @var DateInterval

View File

@ -132,7 +132,7 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface, \Strin
private ?string $canonicalized = ''; private ?string $canonicalized = '';
/** /**
* @var ThirdPartyCategory * @var Collection<ThirdPartyCategory>
* @ORM\ManyToMany(targetEntity="Chill\ThirdPartyBundle\Entity\ThirdPartyCategory") * @ORM\ManyToMany(targetEntity="Chill\ThirdPartyBundle\Entity\ThirdPartyCategory")
* @ORM\JoinTable(name="chill_3party.thirdparty_category", * @ORM\JoinTable(name="chill_3party.thirdparty_category",
* joinColumns={@ORM\JoinColumn(name="thirdparty_id", referencedColumnName="id")}, * joinColumns={@ORM\JoinColumn(name="thirdparty_id", referencedColumnName="id")},
@ -143,6 +143,7 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface, \Strin
private Collection $categories; private Collection $categories;
/** /**
* @var Collection<Center>
* @ORM\ManyToMany(targetEntity="\Chill\MainBundle\Entity\Center") * @ORM\ManyToMany(targetEntity="\Chill\MainBundle\Entity\Center")
* @ORM\JoinTable(name="chill_3party.party_center") * @ORM\JoinTable(name="chill_3party.party_center")
*/ */
@ -154,7 +155,7 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface, \Strin
* @ORM\OneToMany(targetEntity="Chill\ThirdPartyBundle\Entity\ThirdParty", mappedBy="parent", * @ORM\OneToMany(targetEntity="Chill\ThirdPartyBundle\Entity\ThirdParty", mappedBy="parent",
* cascade={"persist"}, orphanRemoval=true) * cascade={"persist"}, orphanRemoval=true)
* *
* @var Collection<(int|string), ThirdParty> * @var Collection<ThirdParty>
* @Assert\Valid(traverse=true) * @Assert\Valid(traverse=true)
*/ */
private Collection $children; private Collection $children;