mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-29 19:13:49 +00:00
Apply rector rules: add annotation for doctrine mapping
This commit is contained in:
@@ -48,13 +48,8 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
||||
/**
|
||||
* Person Class.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* @PersonHasCenter
|
||||
*
|
||||
* @HouseholdMembershipSequential(
|
||||
* groups={"household_memberships"}
|
||||
* )
|
||||
@@ -96,17 +91,14 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
* The person's accompanying periods (when the person was accompanied by the center).
|
||||
*
|
||||
* @var Collection<AccompanyingPeriodParticipation>
|
||||
*
|
||||
*
|
||||
*/
|
||||
#[ORM\OneToMany(targetEntity: AccompanyingPeriodParticipation::class, mappedBy: 'person', cascade: ['persist', 'remove', 'merge', 'detach'])]
|
||||
#[ORM\OrderBy(['startDate' => \Doctrine\Common\Collections\Criteria::DESC])]
|
||||
#[ORM\OrderBy(['startDate' => Criteria::DESC])]
|
||||
private Collection $accompanyingPeriodParticipations;
|
||||
|
||||
/**
|
||||
* The accompanying period requested by the Person.
|
||||
*
|
||||
*
|
||||
* @var Collection<AccompanyingPeriod>
|
||||
*/
|
||||
#[ORM\OneToMany(targetEntity: AccompanyingPeriod::class, mappedBy: 'requestorPerson')]
|
||||
@@ -116,25 +108,21 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
* Addresses.
|
||||
*
|
||||
* @var Collection<Address>
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
#[ORM\ManyToMany(targetEntity: \Chill\MainBundle\Entity\Address::class, cascade: ['persist', 'remove', 'merge', 'detach'])]
|
||||
#[ORM\ManyToMany(targetEntity: Address::class, cascade: ['persist', 'remove', 'merge', 'detach'])]
|
||||
#[ORM\JoinTable(name: 'chill_person_persons_to_addresses')]
|
||||
#[ORM\OrderBy(['validFrom' => \Doctrine\Common\Collections\Criteria::DESC])]
|
||||
#[ORM\OrderBy(['validFrom' => Criteria::DESC])]
|
||||
private Collection $addresses;
|
||||
|
||||
/**
|
||||
* @var Collection<PersonAltName>
|
||||
*/
|
||||
#[ORM\OneToMany(targetEntity: \Chill\PersonBundle\Entity\PersonAltName::class, mappedBy: 'person', cascade: ['persist', 'remove', 'merge', 'detach'], orphanRemoval: true)]
|
||||
#[ORM\OneToMany(targetEntity: PersonAltName::class, mappedBy: 'person', cascade: ['persist', 'remove', 'merge', 'detach'], orphanRemoval: true)]
|
||||
private Collection $altNames;
|
||||
|
||||
/**
|
||||
* The person's birthdate.
|
||||
*
|
||||
*
|
||||
* @Birthdate
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATE_MUTABLE, nullable: true)]
|
||||
@@ -155,16 +143,15 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
/**
|
||||
* @var Collection<int, Calendar>
|
||||
*/
|
||||
#[ORM\ManyToMany(targetEntity: \Chill\CalendarBundle\Entity\Calendar::class, mappedBy: 'persons')]
|
||||
#[ORM\ManyToMany(targetEntity: Calendar::class, mappedBy: 'persons')]
|
||||
private Collection $calendars;
|
||||
|
||||
/**
|
||||
* The person's center.
|
||||
*
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
#[ORM\ManyToOne(targetEntity: \Chill\MainBundle\Entity\Center::class)]
|
||||
#[ORM\ManyToOne(targetEntity: Center::class)]
|
||||
private ?Center $center = null;
|
||||
|
||||
#[ORM\OneToOne(targetEntity: PersonCenterCurrent::class, mappedBy: 'person')]
|
||||
@@ -184,10 +171,8 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
|
||||
/**
|
||||
* The marital status of the person.
|
||||
*
|
||||
*
|
||||
*/
|
||||
#[ORM\ManyToOne(targetEntity: \Chill\MainBundle\Entity\Civility::class)]
|
||||
#[ORM\ManyToOne(targetEntity: Civility::class)]
|
||||
#[ORM\JoinColumn(nullable: true)]
|
||||
private ?Civility $civility = null;
|
||||
|
||||
@@ -199,17 +184,14 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
|
||||
/**
|
||||
* The person's country of birth.
|
||||
*
|
||||
*
|
||||
*/
|
||||
#[ORM\ManyToOne(targetEntity: \Chill\MainBundle\Entity\Country::class)] // sf4 check: option inversedBy="birthsIn" return error mapping !!
|
||||
#[ORM\ManyToOne(targetEntity: Country::class)] // sf4 check: option inversedBy="birthsIn" return error mapping !!
|
||||
#[ORM\JoinColumn(nullable: true)]
|
||||
private ?Country $countryOfBirth = null;
|
||||
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_MUTABLE, nullable: true, options: ['default' => null])]
|
||||
private ?\DateTimeInterface $createdAt = null;
|
||||
|
||||
|
||||
#[ORM\ManyToOne(targetEntity: User::class)]
|
||||
#[ORM\JoinColumn(nullable: true)]
|
||||
private ?User $createdBy = null;
|
||||
@@ -273,7 +255,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
/**
|
||||
* Comment on gender.
|
||||
*/
|
||||
#[ORM\Embedded(class: \Chill\MainBundle\Entity\Embeddable\CommentEmbeddable::class, columnPrefix: 'genderComment_')]
|
||||
#[ORM\Embedded(class: CommentEmbeddable::class, columnPrefix: 'genderComment_')]
|
||||
private CommentEmbeddable $genderComment;
|
||||
|
||||
/**
|
||||
@@ -292,9 +274,6 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
|
||||
/**
|
||||
* The person's id.
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
#[ORM\Id]
|
||||
#[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)]
|
||||
@@ -311,17 +290,15 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
|
||||
/**
|
||||
* The marital status of the person.
|
||||
*
|
||||
*
|
||||
*/
|
||||
#[ORM\ManyToOne(targetEntity: \Chill\PersonBundle\Entity\MaritalStatus::class)]
|
||||
#[ORM\ManyToOne(targetEntity: MaritalStatus::class)]
|
||||
#[ORM\JoinColumn(nullable: true)]
|
||||
private ?MaritalStatus $maritalStatus = null;
|
||||
|
||||
/**
|
||||
* Comment on marital status.
|
||||
*/
|
||||
#[ORM\Embedded(class: \Chill\MainBundle\Entity\Embeddable\CommentEmbeddable::class, columnPrefix: 'maritalStatusComment_')]
|
||||
#[ORM\Embedded(class: CommentEmbeddable::class, columnPrefix: 'maritalStatusComment_')]
|
||||
private CommentEmbeddable $maritalStatusComment;
|
||||
|
||||
/**
|
||||
@@ -347,10 +324,8 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
|
||||
/**
|
||||
* The person's nationality.
|
||||
*
|
||||
*
|
||||
*/
|
||||
#[ORM\ManyToOne(targetEntity: \Chill\MainBundle\Entity\Country::class)] // sf4 check: option inversedBy="nationals" return error mapping !!
|
||||
#[ORM\ManyToOne(targetEntity: Country::class)] // sf4 check: option inversedBy="nationals" return error mapping !!
|
||||
#[ORM\JoinColumn(nullable: true)]
|
||||
private ?Country $nationality = null;
|
||||
|
||||
@@ -364,7 +339,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
* @var Collection<PersonPhone>
|
||||
*/
|
||||
#[Assert\Valid(traverse: true)]
|
||||
#[ORM\OneToMany(targetEntity: \Chill\PersonBundle\Entity\PersonPhone::class, mappedBy: 'person', cascade: ['persist', 'remove', 'merge', 'detach'], orphanRemoval: true)]
|
||||
#[ORM\OneToMany(targetEntity: PersonPhone::class, mappedBy: 'person', cascade: ['persist', 'remove', 'merge', 'detach'], orphanRemoval: true)]
|
||||
private Collection $otherPhoneNumbers;
|
||||
|
||||
/**
|
||||
@@ -376,7 +351,6 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
/**
|
||||
* The person's phonenumber.
|
||||
*
|
||||
*
|
||||
* @PhonenumberConstraint(
|
||||
* type="landline",
|
||||
* )
|
||||
@@ -405,10 +379,8 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
* The person's spoken languages.
|
||||
*
|
||||
* @var Collection<int, Language>
|
||||
*
|
||||
*
|
||||
*/
|
||||
#[ORM\ManyToMany(targetEntity: \Chill\MainBundle\Entity\Language::class)]
|
||||
#[ORM\ManyToMany(targetEntity: Language::class)]
|
||||
#[ORM\JoinTable(name: 'persons_spoken_languages', joinColumns: [new ORM\JoinColumn(name: 'person_id', referencedColumnName: 'id')], inverseJoinColumns: [new ORM\JoinColumn(name: 'language_id', referencedColumnName: 'id')])]
|
||||
private Collection $spokenLanguages;
|
||||
|
||||
|
Reference in New Issue
Block a user