mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
Apply rector rules: add annotation for doctrine mapping
This commit is contained in:
@@ -37,10 +37,10 @@ use Chill\PersonBundle\Validator\Constraints\AccompanyingPeriod\LocationValidity
|
||||
use Chill\PersonBundle\Validator\Constraints\AccompanyingPeriod\ParticipationOverlap;
|
||||
use Chill\PersonBundle\Validator\Constraints\AccompanyingPeriod\ResourceDuplicateCheck;
|
||||
use Chill\ThirdPartyBundle\Entity\ThirdParty;
|
||||
use DateTime;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\Common\Collections\Criteria;
|
||||
use Doctrine\Common\Collections\Order;
|
||||
use Doctrine\Common\Collections\ReadableCollection;
|
||||
use Doctrine\Common\Collections\Selectable;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
@@ -54,8 +54,6 @@ use UnexpectedValueException;
|
||||
/**
|
||||
* AccompanyingPeriod Class.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @AccompanyingPeriodValidity(groups={AccompanyingPeriod::STEP_DRAFT, AccompanyingPeriod::STEP_CONFIRMED})
|
||||
*
|
||||
* @LocationValidity(groups={AccompanyingPeriod::STEP_DRAFT, AccompanyingPeriod::STEP_CONFIRMED})
|
||||
@@ -136,13 +134,13 @@ class AccompanyingPeriod implements
|
||||
|
||||
#[Groups(['read', 'write'])]
|
||||
#[Assert\NotBlank(groups: [AccompanyingPeriod::STEP_CONFIRMED])]
|
||||
#[ORM\ManyToOne(targetEntity: \Chill\MainBundle\Entity\Location::class)]
|
||||
#[ORM\ManyToOne(targetEntity: Location::class)]
|
||||
private ?Location $administrativeLocation = null;
|
||||
|
||||
/**
|
||||
* @var Collection&Selectable<int, Calendar>
|
||||
*/
|
||||
#[ORM\OneToMany(targetEntity: \Chill\CalendarBundle\Entity\Calendar::class, mappedBy: 'accompanyingPeriod')]
|
||||
#[ORM\OneToMany(targetEntity: Calendar::class, mappedBy: 'accompanyingPeriod')]
|
||||
private Collection&Selectable $calendars;
|
||||
|
||||
#[Groups(['read', 'write', 'docgen:read'])]
|
||||
@@ -151,21 +149,18 @@ class AccompanyingPeriod implements
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATE_MUTABLE, nullable: true)]
|
||||
private ?\DateTime $closingDate = null;
|
||||
|
||||
|
||||
#[Groups(['read', 'write'])]
|
||||
#[Assert\NotBlank(groups: [AccompanyingPeriod::STEP_CLOSED])]
|
||||
#[ORM\ManyToOne(targetEntity: \Chill\PersonBundle\Entity\AccompanyingPeriod\ClosingMotive::class)]
|
||||
#[ORM\ManyToOne(targetEntity: ClosingMotive::class)]
|
||||
#[ORM\JoinColumn(nullable: true)]
|
||||
private ?ClosingMotive $closingMotive = null;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @var Collection<Comment>
|
||||
*/
|
||||
#[Assert\NotBlank(groups: [AccompanyingPeriod::STEP_DRAFT])]
|
||||
#[ORM\OneToMany(targetEntity: \Chill\PersonBundle\Entity\AccompanyingPeriod\Comment::class, mappedBy: 'accompanyingPeriod', cascade: ['persist', 'remove'], orphanRemoval: true)]
|
||||
#[ORM\OrderBy(['createdAt' => \Doctrine\Common\Collections\Criteria::DESC, 'id' => 'DESC'])]
|
||||
#[ORM\OneToMany(targetEntity: Comment::class, mappedBy: 'accompanyingPeriod', cascade: ['persist', 'remove'], orphanRemoval: true)]
|
||||
#[ORM\OrderBy(['createdAt' => Order::Descending, 'id' => 'DESC'])]
|
||||
private Collection $comments;
|
||||
|
||||
#[Groups(['read', 'write', 'docgen:read'])]
|
||||
@@ -176,7 +171,6 @@ class AccompanyingPeriod implements
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_MUTABLE, nullable: true, options: ['default' => null])]
|
||||
private ?\DateTimeInterface $createdAt = null;
|
||||
|
||||
|
||||
#[Groups(['read', 'docgen:read'])]
|
||||
#[ORM\ManyToOne(targetEntity: User::class)]
|
||||
#[ORM\JoinColumn(nullable: true)]
|
||||
@@ -186,7 +180,6 @@ class AccompanyingPeriod implements
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN, options: ['default' => false])]
|
||||
private bool $emergency = false;
|
||||
|
||||
|
||||
#[Groups(['read', 'docgen:read'])]
|
||||
#[ORM\Id]
|
||||
#[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)]
|
||||
@@ -215,7 +208,6 @@ class AccompanyingPeriod implements
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATE_MUTABLE)]
|
||||
private ?\DateTime $openingDate = null;
|
||||
|
||||
|
||||
#[Groups(['read', 'write'])]
|
||||
#[Assert\NotBlank(groups: [AccompanyingPeriod::STEP_CONFIRMED])]
|
||||
#[ORM\ManyToOne(targetEntity: Origin::class)]
|
||||
@@ -223,8 +215,8 @@ class AccompanyingPeriod implements
|
||||
private ?Origin $origin = null;
|
||||
|
||||
/**
|
||||
*
|
||||
* @ParticipationOverlap(groups={AccompanyingPeriod::STEP_DRAFT, AccompanyingPeriod::STEP_CONFIRMED})
|
||||
*
|
||||
* @var Collection<AccompanyingPeriodParticipation>
|
||||
*/
|
||||
#[Groups(['read', 'docgen:read'])]
|
||||
@@ -234,7 +226,6 @@ class AccompanyingPeriod implements
|
||||
#[ORM\ManyToOne(targetEntity: Person::class, inversedBy: 'periodLocatedOn')]
|
||||
private ?Person $personLocation = null;
|
||||
|
||||
|
||||
#[Groups(['read'])]
|
||||
#[ORM\ManyToOne(targetEntity: Comment::class, cascade: ['persist'])]
|
||||
#[ORM\JoinColumn(onDelete: 'SET NULL')]
|
||||
@@ -250,12 +241,10 @@ class AccompanyingPeriod implements
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN, options: ['default' => false])]
|
||||
private bool $requestorAnonymous = false;
|
||||
|
||||
|
||||
#[ORM\ManyToOne(targetEntity: Person::class, inversedBy: 'accompanyingPeriodRequested')]
|
||||
#[ORM\JoinColumn(nullable: true)]
|
||||
private ?Person $requestorPerson = null;
|
||||
|
||||
|
||||
#[ORM\ManyToOne(targetEntity: ThirdParty::class)]
|
||||
#[ORM\JoinColumn(nullable: true)]
|
||||
private ?ThirdParty $requestorThirdParty = null;
|
||||
@@ -263,17 +252,14 @@ class AccompanyingPeriod implements
|
||||
/**
|
||||
* @var Collection<resource>
|
||||
*
|
||||
*
|
||||
* @ResourceDuplicateCheck(groups={AccompanyingPeriod::STEP_DRAFT, AccompanyingPeriod::STEP_CONFIRMED, "Default", "default"})
|
||||
*/
|
||||
#[Groups(['read', 'docgen:read'])]
|
||||
#[ORM\OneToMany(targetEntity: \Chill\PersonBundle\Entity\AccompanyingPeriod\Resource::class, mappedBy: 'accompanyingPeriod', cascade: ['persist', 'remove'], orphanRemoval: true)]
|
||||
#[ORM\OneToMany(targetEntity: AccompanyingPeriod\Resource::class, mappedBy: 'accompanyingPeriod', cascade: ['persist', 'remove'], orphanRemoval: true)]
|
||||
private Collection $resources;
|
||||
|
||||
/**
|
||||
* @var Collection<Scope>
|
||||
*
|
||||
*
|
||||
*/
|
||||
#[Groups(['read', 'docgen:read'])]
|
||||
#[Assert\Count(min: 1, groups: [AccompanyingPeriod::STEP_CONFIRMED], minMessage: 'A course must be associated to at least one scope')]
|
||||
@@ -283,8 +269,6 @@ class AccompanyingPeriod implements
|
||||
|
||||
/**
|
||||
* @var Collection<SocialIssue>
|
||||
*
|
||||
*
|
||||
*/
|
||||
#[Groups(['read', 'docgen:read'])]
|
||||
#[Assert\Count(min: 1, groups: [AccompanyingPeriod::STEP_CONFIRMED], minMessage: 'A course must contains at least one social issue')]
|
||||
@@ -311,7 +295,6 @@ class AccompanyingPeriod implements
|
||||
#[ORM\ManyToOne(targetEntity: User::class)]
|
||||
private ?User $updatedBy = null;
|
||||
|
||||
|
||||
#[Groups(['read', 'write', 'docgen:read'])]
|
||||
#[ORM\ManyToOne(targetEntity: User::class)]
|
||||
#[ORM\JoinColumn(nullable: true)]
|
||||
@@ -420,7 +403,7 @@ class AccompanyingPeriod implements
|
||||
|
||||
// ensure continuity of histories
|
||||
$criteria = new Criteria();
|
||||
$criteria->orderBy(['startDate' => \Doctrine\Common\Collections\Order::Ascending, 'id' => \Doctrine\Common\Collections\Order::Ascending]);
|
||||
$criteria->orderBy(['startDate' => Order::Ascending, 'id' => Order::Ascending]);
|
||||
|
||||
/** @var \Iterator $locations */
|
||||
$locations = $this->getLocationHistories()->matching($criteria)->getIterator();
|
||||
@@ -1383,7 +1366,7 @@ class AccompanyingPeriod implements
|
||||
{
|
||||
// ensure continuity of histories
|
||||
$criteria = new Criteria();
|
||||
$criteria->orderBy(['startDate' => \Doctrine\Common\Collections\Order::Ascending, 'id' => \Doctrine\Common\Collections\Order::Ascending]);
|
||||
$criteria->orderBy(['startDate' => Order::Ascending, 'id' => Order::Ascending]);
|
||||
|
||||
/** @var \Iterator $steps */
|
||||
$steps = $this->getStepHistories()->matching($criteria)->getIterator();
|
||||
|
@@ -24,8 +24,6 @@ use Doctrine\ORM\Mapping as ORM;
|
||||
* Usage:
|
||||
*
|
||||
* - get the user involved with an accompanying period
|
||||
*
|
||||
*
|
||||
*/
|
||||
#[ORM\Entity]
|
||||
#[ORM\Table(name: 'view_chill_person_accompanying_period_info')]
|
||||
@@ -40,8 +38,6 @@ class AccompanyingPeriodInfo
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
*
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT)]
|
||||
#[ORM\Id]
|
||||
@@ -49,8 +45,6 @@ class AccompanyingPeriodInfo
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*
|
||||
*
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)]
|
||||
#[ORM\Id]
|
||||
|
@@ -18,7 +18,6 @@ use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||
use Chill\PersonBundle\Entity\Person;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
|
||||
#[ORM\Entity]
|
||||
#[ORM\Table('chill_person_accompanying_period_location_history')]
|
||||
class AccompanyingPeriodLocationHistory implements TrackCreationInterface
|
||||
@@ -31,7 +30,6 @@ class AccompanyingPeriodLocationHistory implements TrackCreationInterface
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATE_IMMUTABLE, nullable: true, options: ['default' => null])]
|
||||
private ?\DateTimeImmutable $endDate = null;
|
||||
|
||||
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)]
|
||||
|
@@ -16,10 +16,8 @@ use Chill\MainBundle\Doctrine\Model\TrackCreationTrait;
|
||||
use Chill\MainBundle\Doctrine\Model\TrackUpdateInterface;
|
||||
use Chill\MainBundle\Doctrine\Model\TrackUpdateTrait;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||
use Chill\PersonBundle\Entity\Person;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
|
||||
#[ORM\Entity]
|
||||
#[ORM\Table('chill_person_accompanying_period_step_history')]
|
||||
class AccompanyingPeriodStepHistory implements TrackCreationInterface, TrackUpdateInterface
|
||||
@@ -31,7 +29,6 @@ class AccompanyingPeriodStepHistory implements TrackCreationInterface, TrackUpda
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATE_IMMUTABLE, nullable: true, options: ['default' => null])]
|
||||
private ?\DateTimeImmutable $endDate = null;
|
||||
|
||||
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)]
|
||||
@@ -46,7 +43,6 @@ class AccompanyingPeriodStepHistory implements TrackCreationInterface, TrackUpda
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT, nullable: false)]
|
||||
private string $step;
|
||||
|
||||
|
||||
#[ORM\ManyToOne(targetEntity: ClosingMotive::class)]
|
||||
#[ORM\JoinColumn(nullable: true)]
|
||||
private ?ClosingMotive $closingMotive = null;
|
||||
|
@@ -24,12 +24,12 @@ use Chill\PersonBundle\Entity\SocialWork\SocialIssue;
|
||||
use Chill\ThirdPartyBundle\Entity\ThirdParty;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\Common\Collections\Order;
|
||||
use Doctrine\Common\Collections\ReadableCollection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Serializer\Annotation as Serializer;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
|
||||
#[Serializer\DiscriminatorMap(typeProperty: 'type', mapping: ['accompanying_period_work' => AccompanyingPeriodWork::class])]
|
||||
#[ORM\Entity]
|
||||
#[ORM\Table(name: 'chill_person_accompanying_period_work')]
|
||||
@@ -41,15 +41,13 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues
|
||||
private ?AccompanyingPeriod $accompanyingPeriod = null;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @var Collection<AccompanyingPeriodWorkEvaluation>
|
||||
*
|
||||
* @internal /!\ the serialization for write evaluations is handled in `AccompanyingPeriodWorkDenormalizer`
|
||||
*/
|
||||
#[Serializer\Groups(['read', 'docgen:read'])]
|
||||
#[ORM\OneToMany(targetEntity: AccompanyingPeriodWorkEvaluation::class, mappedBy: 'accompanyingPeriodWork', cascade: ['remove', 'persist'], orphanRemoval: true)]
|
||||
#[ORM\OrderBy(['startDate' => \Doctrine\Common\Collections\Criteria::DESC, 'id' => 'DESC'])]
|
||||
#[ORM\OrderBy(['startDate' => 'DESC', 'id' => 'DESC'])]
|
||||
private Collection $accompanyingPeriodWorkEvaluations;
|
||||
|
||||
#[Serializer\Groups(['read', 'docgen:read', 'read:accompanyingPeriodWork:light'])]
|
||||
@@ -64,7 +62,6 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT)]
|
||||
private string $createdAutomaticallyReason = '';
|
||||
|
||||
|
||||
#[Serializer\Groups(['read', 'docgen:read', 'read:accompanyingPeriodWork:light'])]
|
||||
#[ORM\ManyToOne(targetEntity: User::class)]
|
||||
#[ORM\JoinColumn(nullable: false)]
|
||||
@@ -86,7 +83,6 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues
|
||||
#[ORM\ManyToOne(targetEntity: ThirdParty::class)]
|
||||
private ?ThirdParty $handlingThierParty = null;
|
||||
|
||||
|
||||
#[Serializer\Groups(['read', 'docgen:read', 'read:accompanyingPeriodWork:light', 'read:evaluation:include-work'])]
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
@@ -99,8 +95,6 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues
|
||||
|
||||
/**
|
||||
* @var Collection<Person>
|
||||
*
|
||||
*
|
||||
*/
|
||||
#[Serializer\Groups(['read', 'docgen:read', 'read:accompanyingPeriodWork:light', 'accompanying_period_work:edit', 'accompanying_period_work:create'])]
|
||||
#[ORM\ManyToMany(targetEntity: Person::class)]
|
||||
@@ -108,7 +102,7 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues
|
||||
private Collection $persons;
|
||||
|
||||
#[Serializer\Groups(['read', 'accompanying_period_work:edit'])]
|
||||
#[ORM\Embedded(class: \Chill\MainBundle\Entity\Embeddable\PrivateCommentEmbeddable::class, columnPrefix: 'privateComment_')]
|
||||
#[ORM\Embedded(class: PrivateCommentEmbeddable::class, columnPrefix: 'privateComment_')]
|
||||
private PrivateCommentEmbeddable $privateComment;
|
||||
|
||||
/**
|
||||
@@ -119,8 +113,6 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues
|
||||
|
||||
/**
|
||||
* @var Collection<Result>
|
||||
*
|
||||
*
|
||||
*/
|
||||
#[Serializer\Groups(['read', 'docgen:read', 'accompanying_period_work:edit'])]
|
||||
#[ORM\ManyToMany(targetEntity: Result::class, inversedBy: 'accompanyingPeriodWorks')]
|
||||
@@ -138,8 +130,6 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues
|
||||
|
||||
/**
|
||||
* @var Collection<ThirdParty>
|
||||
*
|
||||
*
|
||||
*/
|
||||
#[Serializer\Groups(['read', 'docgen:read', 'accompanying_period_work:edit'])]
|
||||
#[ORM\ManyToMany(targetEntity: ThirdParty::class)]
|
||||
@@ -150,13 +140,11 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_IMMUTABLE)]
|
||||
private ?\DateTimeImmutable $updatedAt = null;
|
||||
|
||||
|
||||
#[Serializer\Groups(['read', 'docgen:read'])]
|
||||
#[ORM\ManyToOne(targetEntity: User::class)]
|
||||
#[ORM\JoinColumn(nullable: false)]
|
||||
private ?User $updatedBy = null;
|
||||
|
||||
|
||||
#[Serializer\Groups(['read', 'accompanying_period_work:edit'])]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER, nullable: false, options: ['default' => 1])]
|
||||
#[ORM\Version]
|
||||
|
@@ -15,13 +15,11 @@ use Chill\MainBundle\Doctrine\Model\TrackCreationInterface;
|
||||
use Chill\MainBundle\Doctrine\Model\TrackUpdateInterface;
|
||||
use Chill\MainBundle\Entity\User;
|
||||
use Chill\PersonBundle\Entity\SocialWork\Evaluation;
|
||||
use DateInterval;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Serializer\Annotation as Serializer;
|
||||
|
||||
|
||||
#[Serializer\DiscriminatorMap(typeProperty: 'type', mapping: ['accompanying_period_work_evaluation' => AccompanyingPeriodWorkEvaluation::class])]
|
||||
#[ORM\Entity]
|
||||
#[ORM\Table('chill_person_accompanying_period_work_evaluation')]
|
||||
@@ -49,8 +47,6 @@ class AccompanyingPeriodWorkEvaluation implements TrackCreationInterface, TrackU
|
||||
*
|
||||
* @see{Chill\PersonBundle\Serializer\Normalizer\AccompanyingPeriodWorkEvaluationDenormalizer}
|
||||
*
|
||||
*
|
||||
*
|
||||
* @var Collection<AccompanyingPeriodWorkEvaluationDocument>
|
||||
*/
|
||||
#[Serializer\Groups(['read'])]
|
||||
@@ -66,7 +62,6 @@ class AccompanyingPeriodWorkEvaluation implements TrackCreationInterface, TrackU
|
||||
#[ORM\ManyToOne(targetEntity: Evaluation::class)]
|
||||
private ?Evaluation $evaluation = null;
|
||||
|
||||
|
||||
#[Serializer\Groups(['read', 'docgen:read'])]
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
|
@@ -19,7 +19,6 @@ use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Serializer\Annotation as Serializer;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
|
||||
#[Serializer\DiscriminatorMap(typeProperty: 'type', mapping: ['accompanying_period_work_evaluation_document' => AccompanyingPeriodWorkEvaluationDocument::class])]
|
||||
#[ORM\Entity]
|
||||
#[ORM\Table('chill_person_accompanying_period_work_evaluation_document')]
|
||||
@@ -33,11 +32,7 @@ class AccompanyingPeriodWorkEvaluationDocument implements \Chill\MainBundle\Doct
|
||||
private ?AccompanyingPeriodWorkEvaluation $accompanyingPeriodWorkEvaluation = null;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*
|
||||
* @internal the default name exceeds 64 characters, we must set manually:
|
||||
*
|
||||
*/
|
||||
#[Serializer\Groups(['read', 'accompanying_period_work_evaluation:create'])]
|
||||
#[ORM\Id]
|
||||
|
@@ -18,7 +18,6 @@ use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Serializer\Annotation as Serializer;
|
||||
|
||||
|
||||
#[Serializer\DiscriminatorMap(typeProperty: 'type', mapping: ['accompanying_period_work_goal' => AccompanyingPeriodWorkGoal::class])]
|
||||
#[ORM\Entity]
|
||||
#[ORM\Table(name: 'chill_person_accompanying_period_work_goal')]
|
||||
@@ -31,7 +30,6 @@ class AccompanyingPeriodWorkGoal
|
||||
#[ORM\ManyToOne(targetEntity: Goal::class)]
|
||||
private ?Goal $goal = null;
|
||||
|
||||
|
||||
#[Serializer\Groups(['read', 'docgen:read'])]
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
@@ -44,8 +42,6 @@ class AccompanyingPeriodWorkGoal
|
||||
|
||||
/**
|
||||
* @var Collection<Result>
|
||||
*
|
||||
*
|
||||
*/
|
||||
#[Serializer\Groups(['accompanying_period_work:edit', 'read', 'docgen:read'])]
|
||||
#[ORM\ManyToMany(targetEntity: Result::class, inversedBy: 'accompanyingPeriodWorkGoals')]
|
||||
|
@@ -18,7 +18,6 @@ use Chill\MainBundle\Doctrine\Model\TrackUpdateTrait;
|
||||
use Chill\MainBundle\Entity\User;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
|
||||
#[ORM\Entity]
|
||||
#[ORM\Table(name: 'chill_person_accompanying_period_work_referrer')]
|
||||
class AccompanyingPeriodWorkReferrerHistory implements TrackCreationInterface, TrackUpdateInterface
|
||||
@@ -26,7 +25,6 @@ class AccompanyingPeriodWorkReferrerHistory implements TrackCreationInterface, T
|
||||
use TrackCreationTrait;
|
||||
use TrackUpdateTrait;
|
||||
|
||||
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)]
|
||||
|
@@ -18,8 +18,6 @@ use Symfony\Component\Serializer\Annotation as Serializer;
|
||||
|
||||
/**
|
||||
* ClosingMotive give an explanation why we closed the Accompanying period.
|
||||
*
|
||||
*
|
||||
*/
|
||||
#[ORM\Entity]
|
||||
#[ORM\Table(name: 'chill_person_accompanying_period_closingmotive')]
|
||||
@@ -33,10 +31,9 @@ class ClosingMotive
|
||||
*
|
||||
* @var Collection<ClosingMotive>
|
||||
*/
|
||||
#[ORM\OneToMany(targetEntity: \Chill\PersonBundle\Entity\AccompanyingPeriod\ClosingMotive::class, mappedBy: 'parent')]
|
||||
#[ORM\OneToMany(targetEntity: ClosingMotive::class, mappedBy: 'parent')]
|
||||
private Collection $children;
|
||||
|
||||
|
||||
#[Serializer\Groups(['docgen:read'])]
|
||||
#[ORM\Id]
|
||||
#[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)]
|
||||
@@ -51,7 +48,7 @@ class ClosingMotive
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::FLOAT)]
|
||||
private float $ordering = 0.0;
|
||||
|
||||
#[ORM\ManyToOne(targetEntity: \Chill\PersonBundle\Entity\AccompanyingPeriod\ClosingMotive::class, inversedBy: 'children')]
|
||||
#[ORM\ManyToOne(targetEntity: ClosingMotive::class, inversedBy: 'children')]
|
||||
private ?ClosingMotive $parent = null;
|
||||
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN, nullable: false, options: ['default' => false])]
|
||||
|
@@ -20,14 +20,12 @@ use Symfony\Component\Serializer\Annotation\DiscriminatorMap;
|
||||
use Symfony\Component\Serializer\Annotation\Groups;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
|
||||
#[DiscriminatorMap(typeProperty: 'type', mapping: ['accompanying_period_comment' => Comment::class])]
|
||||
#[ORM\Entity]
|
||||
#[ORM\Table(name: 'chill_person_accompanying_period_comment')]
|
||||
class Comment implements TrackCreationInterface, TrackUpdateInterface
|
||||
{
|
||||
|
||||
#[ORM\ManyToOne(targetEntity: \Chill\PersonBundle\Entity\AccompanyingPeriod::class, inversedBy: 'comments')]
|
||||
#[ORM\ManyToOne(targetEntity: AccompanyingPeriod::class, inversedBy: 'comments')]
|
||||
#[ORM\JoinColumn(nullable: false, onDelete: 'CASCADE')]
|
||||
private ?AccompanyingPeriod $accompanyingPeriod = null;
|
||||
|
||||
@@ -41,13 +39,11 @@ class Comment implements TrackCreationInterface, TrackUpdateInterface
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_MUTABLE)]
|
||||
private ?\DateTimeInterface $createdAt = null;
|
||||
|
||||
|
||||
#[Groups(['read', 'docgen:read'])]
|
||||
#[ORM\ManyToOne(targetEntity: User::class)]
|
||||
#[ORM\JoinColumn(nullable: false)]
|
||||
private ?User $creator = null;
|
||||
|
||||
|
||||
#[Groups(['read', 'docgen:read'])]
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
@@ -58,7 +54,6 @@ class Comment implements TrackCreationInterface, TrackUpdateInterface
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_MUTABLE)]
|
||||
private ?\DateTimeInterface $updatedAt = null;
|
||||
|
||||
|
||||
#[Groups(['read'])]
|
||||
#[ORM\ManyToOne(targetEntity: User::class)]
|
||||
#[ORM\JoinColumn(nullable: false)]
|
||||
|
@@ -14,13 +14,11 @@ namespace Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Serializer\Annotation as Serializer;
|
||||
|
||||
|
||||
#[Serializer\DiscriminatorMap(typeProperty: 'type', mapping: ['origin' => Origin::class])]
|
||||
#[ORM\Entity]
|
||||
#[ORM\Table(name: 'chill_person_accompanying_period_origin')]
|
||||
class Origin
|
||||
{
|
||||
|
||||
#[Serializer\Groups(['read', 'docgen:read'])]
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
|
@@ -20,9 +20,6 @@ use Symfony\Component\Serializer\Annotation\Groups;
|
||||
|
||||
/**
|
||||
* **About denormalization**: this operation is operated by @see{AccompanyingPeriodResourdeNormalizer}.
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
#[DiscriminatorMap(typeProperty: 'type', mapping: ['accompanying_period_resource' => Resource::class])]
|
||||
#[ORM\Entity]
|
||||
@@ -33,8 +30,7 @@ use Symfony\Component\Serializer\Annotation\Groups;
|
||||
#[ORM\UniqueConstraint(name: 'thirdparty_unique', columns: ['thirdparty_id', 'accompanyingperiod_id'])]
|
||||
class Resource
|
||||
{
|
||||
|
||||
#[ORM\ManyToOne(targetEntity: \Chill\PersonBundle\Entity\AccompanyingPeriod::class, inversedBy: 'resources')]
|
||||
#[ORM\ManyToOne(targetEntity: AccompanyingPeriod::class, inversedBy: 'resources')]
|
||||
#[ORM\JoinColumn(nullable: false)]
|
||||
private ?AccompanyingPeriod $accompanyingPeriod = null;
|
||||
|
||||
@@ -42,20 +38,17 @@ class Resource
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT, nullable: true)]
|
||||
private ?string $comment = '';
|
||||
|
||||
|
||||
#[Groups(['read', 'docgen:read'])]
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)]
|
||||
private ?int $id = null;
|
||||
|
||||
|
||||
#[Groups(['docgen:read'])]
|
||||
#[ORM\ManyToOne(targetEntity: Person::class)]
|
||||
#[ORM\JoinColumn(nullable: true)]
|
||||
private ?Person $person = null;
|
||||
|
||||
|
||||
#[Groups(['docgen:read'])]
|
||||
#[ORM\ManyToOne(targetEntity: ThirdParty::class)]
|
||||
#[ORM\JoinColumn(nullable: true)]
|
||||
|
@@ -17,7 +17,6 @@ use Chill\MainBundle\Entity\User;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
|
||||
#[ORM\Entity]
|
||||
#[ORM\Table('chill_person_accompanying_period_user_history')]
|
||||
class UserHistory implements TrackCreationInterface
|
||||
@@ -27,22 +26,18 @@ class UserHistory implements TrackCreationInterface
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_IMMUTABLE, nullable: true, options: ['default' => null])]
|
||||
private ?\DateTimeImmutable $endDate = null;
|
||||
|
||||
|
||||
#[ORM\Id]
|
||||
#[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)]
|
||||
#[ORM\GeneratedValue(strategy: 'AUTO')]
|
||||
private ?int $id = null;
|
||||
|
||||
public function __construct(
|
||||
|
||||
#[ORM\ManyToOne(targetEntity: AccompanyingPeriod::class, inversedBy: 'userHistories')]
|
||||
#[ORM\JoinColumn(nullable: false)]
|
||||
private ?AccompanyingPeriod $accompanyingPeriod,
|
||||
|
||||
#[ORM\ManyToOne(targetEntity: User::class)]
|
||||
#[ORM\JoinColumn(nullable: false)]
|
||||
private User $user,
|
||||
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_IMMUTABLE, nullable: false, options: ['default' => 'now()'])]
|
||||
private \DateTimeImmutable $startDate = new \DateTimeImmutable('now')
|
||||
) {}
|
||||
|
@@ -17,8 +17,6 @@ use Symfony\Component\Serializer\Annotation\Groups;
|
||||
|
||||
/**
|
||||
* AccompanyingPeriodParticipation Class.
|
||||
*
|
||||
*
|
||||
*/
|
||||
#[DiscriminatorMap(typeProperty: 'type', mapping: ['accompanying_period_participation' => AccompanyingPeriodParticipation::class])]
|
||||
#[ORM\Entity]
|
||||
@@ -29,7 +27,6 @@ class AccompanyingPeriodParticipation
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATE_MUTABLE, nullable: true)]
|
||||
private ?\DateTime $endDate = null;
|
||||
|
||||
|
||||
#[Groups(['read', 'docgen:read'])]
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
@@ -43,7 +40,7 @@ class AccompanyingPeriodParticipation
|
||||
public function __construct(
|
||||
#[ORM\ManyToOne(targetEntity: AccompanyingPeriod::class, inversedBy: 'participations', cascade: ['persist'])]
|
||||
#[ORM\JoinColumn(name: 'accompanyingperiod_id', referencedColumnName: 'id', nullable: false)]
|
||||
private ?AccompanyingPeriod $accompanyingPeriod,
|
||||
private ?AccompanyingPeriod $accompanyingPeriod,
|
||||
#[Groups(['read', 'docgen:read'])] #[ORM\ManyToOne(targetEntity: Person::class, inversedBy: 'accompanyingPeriodParticipations')] #[ORM\JoinColumn(name: 'person_id', referencedColumnName: 'id', nullable: false)]
|
||||
private ?Person $person
|
||||
) {
|
||||
|
@@ -26,8 +26,6 @@ use Symfony\Component\Validator\Constraints as Assert;
|
||||
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @MaxHolder(groups={"household_memberships"})
|
||||
*/
|
||||
#[Serializer\DiscriminatorMap(typeProperty: 'type', mapping: ['household' => Household::class])]
|
||||
@@ -39,14 +37,11 @@ class Household
|
||||
* Addresses.
|
||||
*
|
||||
* @var Collection<Address>
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
#[Serializer\Groups(['write'])]
|
||||
#[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_household_to_addresses')]
|
||||
#[ORM\OrderBy(['validFrom' => \Doctrine\Common\Collections\Criteria::DESC, 'id' => 'DESC'])]
|
||||
#[ORM\OrderBy(['validFrom' => Criteria::DESC, 'id' => 'DESC'])]
|
||||
private Collection $addresses;
|
||||
|
||||
#[ORM\Embedded(class: CommentEmbeddable::class, columnPrefix: 'comment_members_')]
|
||||
@@ -54,15 +49,12 @@ class Household
|
||||
|
||||
/**
|
||||
* @var Collection&Selectable<int, HouseholdComposition>
|
||||
*
|
||||
*
|
||||
*/
|
||||
#[Assert\Valid(traverse: true, groups: ['household_composition'])]
|
||||
#[ORM\OneToMany(targetEntity: HouseholdComposition::class, mappedBy: 'household', orphanRemoval: true, cascade: ['persist'])]
|
||||
#[ORM\OrderBy(['startDate' => \Doctrine\Common\Collections\Criteria::DESC])]
|
||||
#[ORM\OrderBy(['startDate' => Criteria::DESC])]
|
||||
private Collection&Selectable $compositions;
|
||||
|
||||
|
||||
#[Serializer\Groups(['read', 'docgen:read'])]
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
|
@@ -20,7 +20,6 @@ use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Serializer\Annotation as Serializer;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
|
||||
#[Serializer\DiscriminatorMap(typeProperty: 'type', mapping: ['household_composition_type' => HouseholdCompositionType::class])]
|
||||
#[ORM\Entity]
|
||||
#[ORM\Table(name: 'chill_person_household_composition')]
|
||||
@@ -38,18 +37,15 @@ class HouseholdComposition implements TrackCreationInterface, TrackUpdateInterfa
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATE_IMMUTABLE, nullable: true, options: ['default' => null])]
|
||||
private ?\DateTimeImmutable $endDate = null;
|
||||
|
||||
|
||||
#[ORM\ManyToOne(targetEntity: Household::class, inversedBy: 'compositions')]
|
||||
#[ORM\JoinColumn(nullable: false)]
|
||||
private ?Household $household = null;
|
||||
|
||||
|
||||
#[Serializer\Groups(['docgen:read'])]
|
||||
#[ORM\ManyToOne(targetEntity: HouseholdCompositionType::class)]
|
||||
#[ORM\JoinColumn(nullable: false)]
|
||||
private ?HouseholdCompositionType $householdCompositionType = null;
|
||||
|
||||
|
||||
#[Serializer\Groups(['read', 'docgen:read'])]
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
|
@@ -14,7 +14,6 @@ namespace Chill\PersonBundle\Entity\Household;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Serializer\Annotation as Serializer;
|
||||
|
||||
|
||||
#[Serializer\DiscriminatorMap(typeProperty: 'type', mapping: ['household_composition_type' => HouseholdCompositionType::class])]
|
||||
#[ORM\Entity]
|
||||
#[ORM\Table(name: 'chill_person_household_composition_type')]
|
||||
@@ -23,7 +22,6 @@ class HouseholdCompositionType
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN)]
|
||||
private bool $active = true;
|
||||
|
||||
|
||||
#[Serializer\Groups(['read', 'docgen:read'])]
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
|
@@ -16,7 +16,6 @@ use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Serializer\Annotation as Serializer;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
|
||||
#[ORM\Entity]
|
||||
#[ORM\Table(name: 'chill_person_household_members')]
|
||||
class HouseholdMember
|
||||
@@ -39,7 +38,6 @@ class HouseholdMember
|
||||
#[ORM\ManyToOne(targetEntity: Household::class)]
|
||||
private ?Household $household = null;
|
||||
|
||||
|
||||
#[Serializer\Groups(['read', 'docgen:read'])]
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
|
@@ -38,26 +38,21 @@ use Doctrine\ORM\Mapping as ORM;
|
||||
* 1. 1st entity: from 2021-01-01 to 2021-06-01, household W, address Q;
|
||||
* 2. 2st entity: from 2021-06-01 to 2021-12-01, household W, address R;
|
||||
* 3. 3st entity: from 2021-12-01 to NULL, household V, address T;
|
||||
*
|
||||
*
|
||||
*/
|
||||
#[ORM\Entity(readOnly: true)]
|
||||
#[ORM\Table(name: 'view_chill_person_household_address')]
|
||||
class PersonHouseholdAddress
|
||||
{
|
||||
|
||||
#[ORM\Id]
|
||||
#[ORM\ManyToOne(targetEntity: Address::class)]
|
||||
#[ORM\JoinColumn(nullable: false)]
|
||||
private ?Address $address = null;
|
||||
|
||||
|
||||
#[ORM\Id]
|
||||
#[ORM\ManyToOne(targetEntity: Household::class)]
|
||||
#[ORM\JoinColumn(nullable: false)]
|
||||
private ?Household $household = null;
|
||||
|
||||
|
||||
#[ORM\Id]
|
||||
#[ORM\ManyToOne(targetEntity: Person::class)]
|
||||
#[ORM\JoinColumn(nullable: false)]
|
||||
|
@@ -14,7 +14,6 @@ namespace Chill\PersonBundle\Entity\Household;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Serializer\Annotation as Serializer;
|
||||
|
||||
|
||||
#[Serializer\DiscriminatorMap(typeProperty: 'type', mapping: ['household_position' => Position::class])]
|
||||
#[ORM\Entity]
|
||||
#[ORM\Table(name: 'chill_person_household_position')]
|
||||
@@ -24,7 +23,6 @@ class Position
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN)]
|
||||
private bool $allowHolder = false;
|
||||
|
||||
|
||||
#[Serializer\Groups(['read', 'docgen:read'])]
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
|
@@ -15,16 +15,12 @@ use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* MaritalStatus.
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
#[ORM\Entity]
|
||||
#[ORM\HasLifecycleCallbacks]
|
||||
#[ORM\Table(name: 'chill_person_marital_status')]
|
||||
class MaritalStatus
|
||||
{
|
||||
|
||||
#[ORM\Id]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 7)]
|
||||
private ?string $id;
|
||||
|
@@ -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;
|
||||
|
||||
|
@@ -21,8 +21,6 @@ use Doctrine\ORM\Mapping as ORM;
|
||||
* The process of selecting the current center is done on database side,
|
||||
* using a SQL view.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @psalm-internal Chill\PersonBundle\Entity
|
||||
*/
|
||||
#[ORM\Entity(readOnly: true)]
|
||||
@@ -35,7 +33,6 @@ class PersonCenterCurrent
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATE_IMMUTABLE, nullable: true, options: ['default' => null])]
|
||||
private ?\DateTimeImmutable $endDate = null;
|
||||
|
||||
|
||||
#[ORM\Id]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)]
|
||||
private ?int $id = null;
|
||||
|
@@ -21,8 +21,6 @@ use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* Associate a Person with a Center. The association may change on date intervals.
|
||||
*
|
||||
*
|
||||
*/
|
||||
#[ORM\Entity]
|
||||
#[ORM\Table(name: 'chill_person_person_center_history')]
|
||||
@@ -35,7 +33,6 @@ class PersonCenterHistory implements TrackCreationInterface, TrackUpdateInterfac
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATE_IMMUTABLE, nullable: true, options: ['default' => null])]
|
||||
private ?\DateTimeImmutable $endDate = null;
|
||||
|
||||
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)]
|
||||
|
@@ -23,8 +23,6 @@ use Doctrine\ORM\Mapping as ORM;
|
||||
*
|
||||
* The validFrom and validTo properties are the intersection of
|
||||
* household membership and address validity. See @see{PersonHouseholdAddress}
|
||||
*
|
||||
*
|
||||
*/
|
||||
#[ORM\Entity(readOnly: true)]
|
||||
#[ORM\Table('view_chill_person_current_address')]
|
||||
@@ -33,7 +31,6 @@ class PersonCurrentAddress
|
||||
#[ORM\OneToOne(targetEntity: Address::class)]
|
||||
protected Address $address;
|
||||
|
||||
|
||||
#[ORM\Id]
|
||||
#[ORM\OneToOne(targetEntity: Person::class, inversedBy: 'currentPersonAddress')]
|
||||
#[ORM\JoinColumn(name: 'person_id', referencedColumnName: 'id')]
|
||||
|
@@ -24,7 +24,6 @@ use Symfony\Component\Serializer\Annotation\Groups;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
||||
|
||||
|
||||
#[Serializer\DiscriminatorMap(typeProperty: 'type', mapping: ['personResource' => PersonResource::class])]
|
||||
#[ORM\Entity]
|
||||
#[ORM\Table(name: 'chill_person_resource')]
|
||||
@@ -35,21 +34,19 @@ class PersonResource implements TrackCreationInterface, TrackUpdateInterface
|
||||
use TrackUpdateTrait;
|
||||
|
||||
#[Groups(['read', 'docgen:read'])]
|
||||
#[ORM\Embedded(class: \Chill\MainBundle\Entity\Embeddable\CommentEmbeddable::class, columnPrefix: 'comment_')]
|
||||
#[ORM\Embedded(class: CommentEmbeddable::class, columnPrefix: 'comment_')]
|
||||
private CommentEmbeddable $comment;
|
||||
|
||||
#[Groups(['read', 'docgen:read'])]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT, nullable: true)]
|
||||
private ?string $freeText = null;
|
||||
|
||||
|
||||
#[Groups(['read', 'docgen:read'])]
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)]
|
||||
private ?int $id = null;
|
||||
|
||||
|
||||
#[Groups(['read', 'docgen:read'])]
|
||||
#[ORM\ManyToOne(targetEntity: PersonResourceKind::class, inversedBy: 'personResources')]
|
||||
#[ORM\JoinColumn(nullable: true)]
|
||||
@@ -57,8 +54,6 @@ class PersonResource implements TrackCreationInterface, TrackUpdateInterface
|
||||
|
||||
/**
|
||||
* The person which host the owner of this resource.
|
||||
*
|
||||
*
|
||||
*/
|
||||
#[Groups(['read', 'docgen:read'])]
|
||||
#[ORM\ManyToOne(targetEntity: Person::class)]
|
||||
@@ -67,15 +62,12 @@ class PersonResource implements TrackCreationInterface, TrackUpdateInterface
|
||||
|
||||
/**
|
||||
* The person linked with this resource.
|
||||
*
|
||||
*
|
||||
*/
|
||||
#[Groups(['read'])]
|
||||
#[ORM\ManyToOne(targetEntity: Person::class, inversedBy: 'resources')]
|
||||
#[ORM\JoinColumn(nullable: false)]
|
||||
private ?Person $personOwner = null;
|
||||
|
||||
|
||||
#[Groups(['read', 'docgen:read'])]
|
||||
#[ORM\ManyToOne(targetEntity: ThirdParty::class, inversedBy: 'personResources')]
|
||||
#[ORM\JoinColumn(nullable: true)]
|
||||
|
@@ -14,12 +14,10 @@ namespace Chill\PersonBundle\Entity\Person;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Serializer\Annotation as Serializer;
|
||||
|
||||
|
||||
#[ORM\Entity]
|
||||
#[ORM\Table(name: 'chill_person_resource_kind')]
|
||||
class PersonResourceKind
|
||||
{
|
||||
|
||||
#[Serializer\Groups(['docgen:read'])]
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
|
@@ -20,44 +20,38 @@ use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Serializer\Annotation\Context;
|
||||
use Symfony\Component\Serializer\Annotation\Groups;
|
||||
|
||||
|
||||
#[ORM\Entity(repositoryClass: ResidentialAddressRepository::class)]
|
||||
#[ORM\Table(name: 'chill_person_residential_address')]
|
||||
class ResidentialAddress
|
||||
{
|
||||
|
||||
#[Groups(['read'])]
|
||||
#[ORM\ManyToOne(targetEntity: Address::class)]
|
||||
#[ORM\JoinColumn(nullable: true)]
|
||||
private ?Address $address = null;
|
||||
|
||||
#[ORM\Embedded(class: \Chill\MainBundle\Entity\Embeddable\CommentEmbeddable::class, columnPrefix: 'residentialAddressComment_')]
|
||||
#[ORM\Embedded(class: CommentEmbeddable::class, columnPrefix: 'residentialAddressComment_')]
|
||||
private CommentEmbeddable $comment;
|
||||
|
||||
#[Groups(['read'])]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_IMMUTABLE, nullable: true)]
|
||||
private ?\DateTimeImmutable $endDate = null;
|
||||
|
||||
|
||||
#[Groups(['read'])]
|
||||
#[ORM\ManyToOne(targetEntity: Person::class)]
|
||||
#[ORM\JoinColumn(nullable: true)]
|
||||
#[Context(normalizationContext: ['groups' => ['minimal']])]
|
||||
private ?Person $hostPerson = null;
|
||||
|
||||
|
||||
#[Groups(['read'])]
|
||||
#[ORM\ManyToOne(targetEntity: ThirdParty::class)]
|
||||
#[ORM\JoinColumn(nullable: true)]
|
||||
private ?ThirdParty $hostThirdParty = null;
|
||||
|
||||
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)]
|
||||
private ?int $id = null;
|
||||
|
||||
|
||||
#[ORM\ManyToOne(targetEntity: Person::class)]
|
||||
#[ORM\JoinColumn(nullable: false)]
|
||||
private Person $person;
|
||||
|
@@ -16,14 +16,11 @@ use Symfony\Component\Serializer\Annotation\Groups;
|
||||
|
||||
/**
|
||||
* PersonAltName.
|
||||
*
|
||||
*
|
||||
*/
|
||||
#[ORM\Entity]
|
||||
#[ORM\Table(name: 'chill_person_alt_name')]
|
||||
class PersonAltName
|
||||
{
|
||||
|
||||
#[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)]
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue(strategy: 'AUTO')]
|
||||
@@ -37,7 +34,7 @@ class PersonAltName
|
||||
#[ORM\Column(name: 'label', type: \Doctrine\DBAL\Types\Types::TEXT)]
|
||||
private string $label = '';
|
||||
|
||||
#[ORM\ManyToOne(targetEntity: \Chill\PersonBundle\Entity\Person::class, inversedBy: 'altNames')]
|
||||
#[ORM\ManyToOne(targetEntity: Person::class, inversedBy: 'altNames')]
|
||||
private ?Person $person = null;
|
||||
|
||||
/**
|
||||
|
@@ -12,13 +12,10 @@ declare(strict_types=1);
|
||||
namespace Chill\PersonBundle\Entity;
|
||||
|
||||
use Chill\MainBundle\Entity\User;
|
||||
use DateTime;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* PersonNotDuplicate.
|
||||
*
|
||||
*
|
||||
*/
|
||||
#[ORM\Entity]
|
||||
#[ORM\Table(name: 'chill_person_not_duplicate')]
|
||||
@@ -29,22 +26,19 @@ class PersonNotDuplicate
|
||||
|
||||
/**
|
||||
* The person's id.
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
#[ORM\Id]
|
||||
#[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)]
|
||||
#[ORM\GeneratedValue(strategy: 'AUTO')]
|
||||
private ?int $id = null;
|
||||
|
||||
#[ORM\ManyToOne(targetEntity: \Chill\PersonBundle\Entity\Person::class)]
|
||||
#[ORM\ManyToOne(targetEntity: Person::class)]
|
||||
private ?Person $person1 = null;
|
||||
|
||||
#[ORM\ManyToOne(targetEntity: \Chill\PersonBundle\Entity\Person::class)]
|
||||
#[ORM\ManyToOne(targetEntity: Person::class)]
|
||||
private ?Person $person2 = null;
|
||||
|
||||
#[ORM\ManyToOne(targetEntity: \Chill\MainBundle\Entity\User::class)]
|
||||
#[ORM\ManyToOne(targetEntity: User::class)]
|
||||
private ?User $user = null;
|
||||
|
||||
public function __construct()
|
||||
|
@@ -11,13 +11,11 @@ declare(strict_types=1);
|
||||
|
||||
namespace Chill\PersonBundle\Entity;
|
||||
|
||||
use DateTime;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use libphonenumber\PhoneNumber;
|
||||
|
||||
/**
|
||||
* Person Phones.
|
||||
*
|
||||
*/
|
||||
#[ORM\Entity]
|
||||
#[ORM\Table(name: 'chill_person_phone')]
|
||||
@@ -31,13 +29,12 @@ class PersonPhone
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT, nullable: true)]
|
||||
private ?string $description = null;
|
||||
|
||||
|
||||
#[ORM\Id]
|
||||
#[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)]
|
||||
#[ORM\GeneratedValue(strategy: 'AUTO')]
|
||||
private ?int $id = null;
|
||||
|
||||
#[ORM\ManyToOne(targetEntity: \Chill\PersonBundle\Entity\Person::class, inversedBy: 'otherPhoneNumbers')]
|
||||
#[ORM\ManyToOne(targetEntity: Person::class, inversedBy: 'otherPhoneNumbers')]
|
||||
private Person $person;
|
||||
|
||||
#[ORM\Column(type: 'phone_number', nullable: false)]
|
||||
|
@@ -15,13 +15,11 @@ use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Serializer\Annotation as Serializer;
|
||||
use Symfony\Component\Serializer\Annotation\DiscriminatorMap;
|
||||
|
||||
|
||||
#[DiscriminatorMap(typeProperty: 'type', mapping: ['relation' => Relation::class])]
|
||||
#[ORM\Entity]
|
||||
#[ORM\Table(name: 'chill_person_relations')]
|
||||
class Relation
|
||||
{
|
||||
|
||||
#[Serializer\Groups(['read', 'docgen:read'])]
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
|
@@ -24,9 +24,6 @@ use Symfony\Component\Serializer\Annotation\DiscriminatorMap;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*
|
||||
* @RelationshipNoDuplicate
|
||||
*/
|
||||
#[DiscriminatorMap(typeProperty: 'type', mapping: ['relationship' => Relationship::class])]
|
||||
@@ -38,26 +35,22 @@ class Relationship implements TrackCreationInterface, TrackUpdateInterface
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_IMMUTABLE)]
|
||||
private ?\DateTimeImmutable $createdAt = null;
|
||||
|
||||
|
||||
#[ORM\ManyToOne(targetEntity: User::class)]
|
||||
#[ORM\JoinColumn(nullable: false)]
|
||||
private ?User $createdBy = null;
|
||||
|
||||
|
||||
#[Assert\NotNull]
|
||||
#[Serializer\Groups(['read', 'write'])]
|
||||
#[ORM\ManyToOne(targetEntity: Person::class)]
|
||||
#[ORM\JoinColumn(nullable: false)]
|
||||
private ?Person $fromPerson = null;
|
||||
|
||||
|
||||
#[Serializer\Groups(['read'])]
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)]
|
||||
private ?int $id = null;
|
||||
|
||||
|
||||
#[Assert\NotNull]
|
||||
#[Serializer\Groups(['read', 'write'])]
|
||||
#[ORM\ManyToOne(targetEntity: Relation::class)]
|
||||
@@ -69,7 +62,6 @@ class Relationship implements TrackCreationInterface, TrackUpdateInterface
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN)]
|
||||
private bool $reverse;
|
||||
|
||||
|
||||
#[Assert\NotNull]
|
||||
#[Serializer\Groups(['read', 'write'])]
|
||||
#[ORM\ManyToOne(targetEntity: Person::class)]
|
||||
|
@@ -11,13 +11,11 @@ declare(strict_types=1);
|
||||
|
||||
namespace Chill\PersonBundle\Entity\SocialWork;
|
||||
|
||||
use DateInterval;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Serializer\Annotation as Serializer;
|
||||
|
||||
|
||||
#[Serializer\DiscriminatorMap(typeProperty: 'type', mapping: ['social_work_evaluation' => Evaluation::class])]
|
||||
#[ORM\Entity]
|
||||
#[ORM\Table(name: 'chill_person_social_work_evaluation')]
|
||||
@@ -30,7 +28,6 @@ class Evaluation
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATEINTERVAL, nullable: true, options: ['default' => null])]
|
||||
private ?\DateInterval $delay = null;
|
||||
|
||||
|
||||
#[Serializer\Groups(['read', 'docgen:read'])]
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
|
@@ -16,7 +16,6 @@ use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Serializer\Annotation as Serializer;
|
||||
|
||||
|
||||
#[Serializer\DiscriminatorMap(typeProperty: 'type', mapping: ['social_work_goal' => Goal::class])]
|
||||
#[ORM\Entity]
|
||||
#[ORM\Table(name: 'chill_person_social_work_goal')]
|
||||
@@ -25,7 +24,6 @@ class Goal
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_MUTABLE, nullable: true)]
|
||||
private ?\DateTimeInterface $desactivationDate = null;
|
||||
|
||||
|
||||
#[Serializer\Groups(['read', 'docgen:read'])]
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
@@ -34,8 +32,6 @@ class Goal
|
||||
|
||||
/**
|
||||
* @var Collection<Result>
|
||||
*
|
||||
*
|
||||
*/
|
||||
#[ORM\ManyToMany(targetEntity: Result::class, inversedBy: 'goals')]
|
||||
#[ORM\JoinTable(name: 'chill_person_social_work_goal_result')]
|
||||
|
@@ -13,13 +13,11 @@ namespace Chill\PersonBundle\Entity\SocialWork;
|
||||
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWork;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWorkGoal;
|
||||
use DateTime;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Serializer\Annotation as Serializer;
|
||||
|
||||
|
||||
#[Serializer\DiscriminatorMap(typeProperty: 'type', mapping: ['social_work_result' => Result::class])]
|
||||
#[ORM\Entity]
|
||||
#[ORM\Table(name: 'chill_person_social_work_result')]
|
||||
@@ -46,7 +44,6 @@ class Result
|
||||
#[ORM\ManyToMany(targetEntity: Goal::class, mappedBy: 'results')]
|
||||
private Collection $goals;
|
||||
|
||||
|
||||
#[Serializer\Groups(['read', 'docgen:read'])]
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
|
@@ -11,14 +11,12 @@ declare(strict_types=1);
|
||||
|
||||
namespace Chill\PersonBundle\Entity\SocialWork;
|
||||
|
||||
use DateInterval;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\Common\Collections\ReadableCollection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Serializer\Annotation as Serializer;
|
||||
|
||||
|
||||
#[Serializer\DiscriminatorMap(typeProperty: 'type', mapping: ['social_work_social_action' => SocialAction::class])]
|
||||
#[ORM\Entity]
|
||||
#[ORM\Table(name: 'chill_person_social_action')]
|
||||
@@ -38,8 +36,6 @@ class SocialAction
|
||||
|
||||
/**
|
||||
* @var Collection<Evaluation>
|
||||
*
|
||||
*
|
||||
*/
|
||||
#[ORM\ManyToMany(targetEntity: Evaluation::class, inversedBy: 'socialActions')]
|
||||
#[ORM\JoinTable(name: 'chill_person_social_work_evaluation_action')]
|
||||
@@ -47,14 +43,11 @@ class SocialAction
|
||||
|
||||
/**
|
||||
* @var Collection<Goal>
|
||||
*
|
||||
*
|
||||
*/
|
||||
#[ORM\ManyToMany(targetEntity: Goal::class, inversedBy: 'socialActions')]
|
||||
#[ORM\JoinTable(name: 'chill_person_social_action_goal')]
|
||||
private Collection $goals;
|
||||
|
||||
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)]
|
||||
@@ -71,8 +64,6 @@ class SocialAction
|
||||
|
||||
/**
|
||||
* @var Collection<Result>
|
||||
*
|
||||
*
|
||||
*/
|
||||
#[ORM\ManyToMany(targetEntity: Result::class, inversedBy: 'socialActions')]
|
||||
#[ORM\JoinTable(name: 'chill_person_social_action_result')]
|
||||
|
@@ -17,7 +17,6 @@ use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Serializer\Annotation\DiscriminatorMap;
|
||||
use Symfony\Component\Serializer\Annotation\Groups;
|
||||
|
||||
|
||||
#[DiscriminatorMap(typeProperty: 'type', mapping: ['social_issue' => SocialIssue::class])]
|
||||
#[ORM\Entity]
|
||||
#[ORM\Table(name: 'chill_person_social_issue')]
|
||||
@@ -32,7 +31,6 @@ class SocialIssue
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_MUTABLE, nullable: true)]
|
||||
private ?\DateTimeInterface $desactivationDate = null;
|
||||
|
||||
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)]
|
||||
|
@@ -28,7 +28,7 @@ class ByStepFilterTest extends AbstractFilterTest
|
||||
public function getFilter()
|
||||
{
|
||||
$translator = new class () implements TranslatorInterface {
|
||||
public function trans(string $id, array $parameters = [], string $domain = null, string $locale = null)
|
||||
public function trans(string $id, array $parameters = [], ?string $domain = null, ?string $locale = null)
|
||||
{
|
||||
return $id;
|
||||
}
|
||||
|
Reference in New Issue
Block a user