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

@@ -20,70 +20,51 @@ 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_composition"
* )
*/
#[Serializer\DiscriminatorMap(typeProperty: 'type', mapping: ['household_composition_type' => HouseholdCompositionType::class])]
#[ORM\Entity]
#[ORM\Table(name: 'chill_person_household_composition')]
class HouseholdComposition implements TrackCreationInterface, TrackUpdateInterface
{
use TrackCreationTrait;
use TrackUpdateTrait;
/**
* @ORM\Embedded(class=CommentEmbeddable::class, columnPrefix="comment_")
*/
#[ORM\Embedded(class: CommentEmbeddable::class, columnPrefix: 'comment_')]
private CommentEmbeddable $comment;
/**
* @ORM\Column(type="date_immutable", nullable=true, options={"default": null})
*/
#[Assert\GreaterThanOrEqual(propertyPath: 'startDate', groups: ['Default', 'household_composition'])]
#[Serializer\Groups(['docgen:read'])]
#[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)
*/
#[ORM\ManyToOne(targetEntity: Household::class, inversedBy: 'compositions')]
#[ORM\JoinColumn(nullable: false)]
private ?Household $household = null;
/**
* @ORM\ManyToOne(targetEntity=HouseholdCompositionType::class)
*
* @ORM\JoinColumn(nullable=false)
*/
#[Serializer\Groups(['docgen:read'])]
#[ORM\ManyToOne(targetEntity: HouseholdCompositionType::class)]
#[ORM\JoinColumn(nullable: false)]
private ?HouseholdCompositionType $householdCompositionType = 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;
/**
* @ORM\Column(type="integer", nullable=true, options={"default": null})
*/
#[Assert\NotNull]
#[Assert\GreaterThanOrEqual(0, groups: ['Default', 'household_composition'])]
#[Serializer\Groups(['docgen:read'])]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER, nullable: true, options: ['default' => null])]
private ?int $numberOfChildren = null;
/**
* @ORM\Column(type="date_immutable", nullable=false)
*/
#[Assert\NotNull(groups: ['Default', 'household_composition'])]
#[Serializer\Groups(['docgen:read'])]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATE_IMMUTABLE, nullable: false)]
private ?\DateTimeImmutable $startDate = null;
public function __construct()