Apply rector rules: add annotation for doctrine mapping

This commit is contained in:
2024-04-05 00:01:30 +02:00
parent 579bd829f8
commit 72016e1a21
124 changed files with 1724 additions and 3770 deletions

View File

@@ -21,43 +21,29 @@ use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation as Serializer;
/**
* @ORM\Entity
*
* @ORM\Table("chill_person_accompanying_period_work_evaluation")
*/
#[Serializer\DiscriminatorMap(typeProperty: 'type', mapping: ['accompanying_period_work_evaluation' => AccompanyingPeriodWorkEvaluation::class])]
#[ORM\Entity]
#[ORM\Table('chill_person_accompanying_period_work_evaluation')]
class AccompanyingPeriodWorkEvaluation implements TrackCreationInterface, TrackUpdateInterface
{
/**
* @ORM\ManyToOne(
* targetEntity=AccompanyingPeriodWork::class,
* inversedBy="accompanyingPeriodWorkEvaluations"
* )
*
* @Serializer\Context(normalizationContext={"groups": {"read:accompanyingPeriodWork:light"}}, groups={"read:evaluation:include-work"})
*/
#[Serializer\Groups(['read:evaluation:include-work'])]
#[ORM\ManyToOne(targetEntity: AccompanyingPeriodWork::class, inversedBy: 'accompanyingPeriodWorkEvaluations')]
private ?AccompanyingPeriodWork $accompanyingPeriodWork = null;
/**
* @ORM\Column(type="text", nullable=false, options={"default": ""})
*/
#[Serializer\Groups(['read', 'docgen:read', 'write', 'accompanying_period_work_evaluation:create'])]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT, nullable: false, options: ['default' => ''])]
private string $comment = '';
/**
* @ORM\Column(type="date_immutable", nullable=true, options={"default": null})
*/
#[Serializer\Groups(['read', 'docgen:read'])]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATE_IMMUTABLE, nullable: true, options: ['default' => null])]
private ?\DateTimeImmutable $createdAt = null;
/**
* @ORM\ManyToOne(
* targetEntity=User::class
* )
*/
#[Serializer\Groups(['read', 'docgen:read'])]
#[ORM\ManyToOne(targetEntity: User::class)]
private ?User $createdBy = null;
/**
@@ -65,42 +51,28 @@ class AccompanyingPeriodWorkEvaluation implements TrackCreationInterface, TrackU
*
* @see{Chill\PersonBundle\Serializer\Normalizer\AccompanyingPeriodWorkEvaluationDenormalizer}
*
* @ORM\OneToMany(
* targetEntity=AccompanyingPeriodWorkEvaluationDocument::class,
* mappedBy="accompanyingPeriodWorkEvaluation",
* cascade={"remove", "persist"},
* orphanRemoval=true
* )
*
* @ORM\OrderBy({"createdAt": "DESC", "id": "DESC"})
*
* @var Collection<AccompanyingPeriodWorkEvaluationDocument>
*/
#[Serializer\Groups(['read'])]
#[ORM\OneToMany(targetEntity: AccompanyingPeriodWorkEvaluationDocument::class, mappedBy: 'accompanyingPeriodWorkEvaluation', cascade: ['remove', 'persist'], orphanRemoval: true)]
#[ORM\OrderBy(['createdAt' => \Doctrine\Common\Collections\Criteria::DESC, 'id' => 'DESC'])]
private Collection $documents;
/**
* @ORM\Column(type="date_immutable", nullable=true, options={"default": null})
*/
#[Serializer\Groups(['read', 'docgen:read', 'write', 'accompanying_period_work_evaluation:create'])]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATE_IMMUTABLE, nullable: true, options: ['default' => null])]
private ?\DateTimeImmutable $endDate = null;
/**
* @ORM\ManyToOne(
* targetEntity=Evaluation::class
* )
*/
#[Serializer\Groups(['read', 'docgen:read', 'accompanying_period_work_evaluation:create'])]
#[ORM\ManyToOne(targetEntity: Evaluation::class)]
private ?Evaluation $evaluation = null;
/**
* @ORM\Id
*
* @ORM\GeneratedValue
*
* @ORM\Column(type="integer")
*/
#[Serializer\Groups(['read', 'docgen:read'])]
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)]
private ?int $id = null;
/**
@@ -113,42 +85,28 @@ class AccompanyingPeriodWorkEvaluation implements TrackCreationInterface, TrackU
#[Serializer\Groups(['read', 'write', 'accompanying_period_work_evaluation:create'])]
private $key;
/**
* @ORM\Column(type="date_immutable", nullable=true, options={"default": null})
*/
#[Serializer\Groups(['read', 'docgen:read', 'write', 'accompanying_period_work_evaluation:create'])]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATE_IMMUTABLE, nullable: true, options: ['default' => null])]
private ?\DateTimeImmutable $maxDate = null;
/**
* @ORM\Column(type="date_immutable", nullable=true, options={"default": null})
*/
#[Serializer\Groups(['read', 'docgen:read', 'write', 'accompanying_period_work_evaluation:create'])]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATE_IMMUTABLE, nullable: true, options: ['default' => null])]
private ?\DateTimeImmutable $startDate = null;
/**
* @ORM\Column(type="date_immutable", nullable=true, options={"default": null})
*/
#[Serializer\Groups(['read', 'docgen:read'])]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATE_IMMUTABLE, nullable: true, options: ['default' => null])]
private ?\DateTimeImmutable $updatedAt = null;
/**
* @ORM\ManyToOne(
* targetEntity=User::class
* )
*/
#[Serializer\Groups(['read', 'docgen:read'])]
#[ORM\ManyToOne(targetEntity: User::class)]
private ?User $updatedBy = null;
/**
* @ORM\Column(type="dateinterval", nullable=true, options={"default": null})
*/
#[Serializer\Groups(['read', 'write', 'accompanying_period_work_evaluation:create'])]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATEINTERVAL, nullable: true, options: ['default' => null])]
private ?\DateInterval $warningInterval = null;
/**
* @ORM\Column(type="integer", nullable=true)
*/
#[Serializer\Groups(['read', 'docgen:read', 'write', 'accompanying_period_work_evaluation:create'])]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER, nullable: true)]
private ?int $timeSpent = null;
public function __construct()