mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-28 01:25:00 +00:00
Apply rector rules: add annotation for doctrine mapping
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user