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,14 +21,10 @@ use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Table(
* name="chill_calendar.calendar_range",
* uniqueConstraints={@ORM\UniqueConstraint(name="idx_calendar_range_remote", columns={"remoteId"}, options={"where": "remoteId <> ''"})}
* )
*
* @ORM\Entity
*/
#[ORM\Entity]
#[ORM\Table(name: 'chill_calendar.calendar_range')]
#[ORM\UniqueConstraint(name: 'idx_calendar_range_remote', columns: ['remoteId'], options: ['where' => "remoteId <> ''"])]
class CalendarRange implements TrackCreationInterface, TrackUpdateInterface
{
use RemoteCalendarTrait;
@@ -37,49 +33,36 @@ class CalendarRange implements TrackCreationInterface, TrackUpdateInterface
use TrackUpdateTrait;
/**
* @ORM\OneToOne(targetEntity=Calendar::class, mappedBy="calendarRange")
*/
#[ORM\OneToOne(targetEntity: Calendar::class, mappedBy: 'calendarRange')]
private ?Calendar $calendar = null;
/**
* @ORM\Column(type="datetime_immutable", nullable=false)
*/
#[Groups(['read', 'write', 'calendar:read'])]
#[Assert\NotNull]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_IMMUTABLE, nullable: false)]
private ?\DateTimeImmutable $endDate = null;
/**
* @ORM\Id
*
* @ORM\GeneratedValue
*
* @ORM\Column(type="integer")
*/
#[Groups(['read'])]
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)]
private ?int $id = null;
/**
* @ORM\ManyToOne(targetEntity=Location::class)
*
* @ORM\JoinColumn(nullable=false)
*/
#[Groups(['read', 'write', 'calendar:read'])]
#[Assert\NotNull]
#[ORM\ManyToOne(targetEntity: Location::class)]
#[ORM\JoinColumn(nullable: false)]
private ?Location $location = null;
/**
* @ORM\Column(type="datetime_immutable", nullable=false)
*/
#[Groups(['read', 'write', 'calendar:read'])]
#[Assert\NotNull]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_IMMUTABLE, nullable: false)]
private ?\DateTimeImmutable $startDate = null;
/**
* @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\User")
*/
#[Groups(['read', 'write', 'calendar:read'])]
#[Assert\NotNull]
#[ORM\ManyToOne(targetEntity: \Chill\MainBundle\Entity\User::class)]
private ?User $user = null;
public function getCalendar(): ?Calendar