Apply rector rules: add annotation for doctrine mapping

This commit is contained in:
2024-04-05 13:11:42 +02:00
parent a3f775a69b
commit 0ff4593863
118 changed files with 143 additions and 658 deletions

View File

@@ -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]