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

@@ -36,7 +36,6 @@ use Symfony\Component\Validator\Constraints\NotBlank;
use Symfony\Component\Validator\Constraints\Range;
use Symfony\Component\Validator\Mapping\ClassMetadata;
#[Serializer\DiscriminatorMap(typeProperty: 'type', mapping: ['chill_calendar_calendar' => Calendar::class])]
#[ORM\Entity]
#[ORM\Table(name: 'chill_calendar.calendar')]
@@ -83,17 +82,17 @@ class Calendar implements TrackCreationInterface, TrackUpdateInterface, HasCente
public ?User $previousMainUser = null;
#[Serializer\Groups(['calendar:read', 'read'])]
#[ORM\ManyToOne(targetEntity: \Chill\PersonBundle\Entity\AccompanyingPeriod::class, inversedBy: 'calendars')]
#[ORM\ManyToOne(targetEntity: AccompanyingPeriod::class, inversedBy: 'calendars')]
private ?AccompanyingPeriod $accompanyingPeriod = null;
#[ORM\ManyToOne(targetEntity: \Chill\ActivityBundle\Entity\Activity::class)]
#[ORM\ManyToOne(targetEntity: Activity::class)]
private ?Activity $activity = null;
#[Serializer\Groups(['calendar:read', 'read'])]
#[ORM\OneToOne(targetEntity: \CalendarRange::class, inversedBy: 'calendar')]
#[ORM\OneToOne(targetEntity: CalendarRange::class, inversedBy: 'calendar')]
private ?CalendarRange $calendarRange = null;
#[ORM\ManyToOne(targetEntity: \CancelReason::class)]
#[ORM\ManyToOne(targetEntity: CancelReason::class)]
private ?CancelReason $cancelReason = null;
#[Serializer\Groups(['calendar:read', 'read', 'docgen:read'])]
@@ -114,7 +113,6 @@ class Calendar implements TrackCreationInterface, TrackUpdateInterface, HasCente
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_IMMUTABLE, nullable: false)]
private ?\DateTimeImmutable $endDate = null;
#[Serializer\Groups(['calendar:read', 'read', 'calendar:light', 'docgen:read'])]
#[ORM\Id]
#[ORM\GeneratedValue]
@@ -122,8 +120,6 @@ class Calendar implements TrackCreationInterface, TrackUpdateInterface, HasCente
private ?int $id = null;
/**
*
*
* @var Collection&Selectable<int, Invite>
*/
#[Serializer\Groups(['read', 'docgen:read'])]
@@ -133,29 +129,25 @@ class Calendar implements TrackCreationInterface, TrackUpdateInterface, HasCente
#[Serializer\Groups(['read', 'docgen:read'])]
#[Assert\NotNull(message: 'calendar.A location is required')]
#[ORM\ManyToOne(targetEntity: \Chill\MainBundle\Entity\Location::class)]
#[ORM\ManyToOne(targetEntity: Location::class)]
private ?Location $location = null;
#[Serializer\Groups(['calendar:read', 'read', 'calendar:light', 'docgen:read'])]
#[Assert\NotNull(message: 'calendar.A main user is mandatory')]
#[ORM\ManyToOne(targetEntity: \Chill\MainBundle\Entity\User::class)]
#[ORM\ManyToOne(targetEntity: User::class)]
#[Serializer\Context(normalizationContext: ['read'], groups: ['calendar:light'])]
private ?User $mainUser = null;
#[ORM\ManyToOne(targetEntity: Person::class)]
#[ORM\JoinColumn(nullable: true)]
private ?Person $person = null;
/**
*
*
*
* @var Collection<Person>
*/
#[Serializer\Groups(['calendar:read', 'read', 'calendar:light', 'docgen:read'])]
#[Assert\Count(min: 1, minMessage: 'calendar.At least {{ limit }} person is required.')]
#[ORM\ManyToMany(targetEntity: \Chill\PersonBundle\Entity\Person::class, inversedBy: 'calendars')]
#[ORM\ManyToMany(targetEntity: Person::class, inversedBy: 'calendars')]
#[ORM\JoinTable(name: 'chill_calendar.calendar_to_persons')]
#[Serializer\Context(normalizationContext: ['read'], groups: ['calendar:light'])]
private Collection $persons;
@@ -166,11 +158,9 @@ class Calendar implements TrackCreationInterface, TrackUpdateInterface, HasCente
/**
* @var Collection<ThirdParty>
*
*
*/
#[Serializer\Groups(['calendar:read', 'read', 'calendar:light', 'docgen:read'])]
#[ORM\ManyToMany(targetEntity: \Chill\ThirdPartyBundle\Entity\ThirdParty::class)]
#[ORM\ManyToMany(targetEntity: ThirdParty::class)]
#[ORM\JoinTable(name: 'chill_calendar.calendar_to_thirdparties')]
#[Serializer\Context(normalizationContext: ['read'], groups: ['calendar:light'])]
private Collection $professionals;