130 lines
2.8 KiB
PHP
130 lines
2.8 KiB
PHP
<?php
|
|
|
|
namespace App\Entity\Groups;
|
|
|
|
use App\Entity\BlameableEntity;
|
|
use App\Entity\BlameableEntityInterface;
|
|
use App\Entity\TimestampableEntity;
|
|
use App\Entity\TimestampableEntityInterface;
|
|
use App\Repository\Groups\BoardServiceRepository;
|
|
use Doctrine\DBAL\Types\Types;
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
use Symfony\Component\Validator\Constraints as Assert;
|
|
|
|
#[ORM\Entity(repositoryClass: BoardServiceRepository::class)]
|
|
class BoardService implements BlameableEntityInterface, TimestampableEntityInterface
|
|
{
|
|
use BlameableEntity;
|
|
use TimestampableEntity;
|
|
|
|
#[ORM\Id]
|
|
#[ORM\GeneratedValue]
|
|
#[ORM\Column]
|
|
private ?int $id = null;
|
|
|
|
#[ORM\ManyToOne(inversedBy: 'boardServices')]
|
|
#[ORM\JoinColumn(nullable: false)]
|
|
private ?Accommodation $accommodation = null;
|
|
|
|
#[ORM\Column(length: 255)]
|
|
#[Assert\NotBlank(message: 'required')]
|
|
private ?string $label = null;
|
|
|
|
#[ORM\Column(type: 'text', nullable: true)]
|
|
private ?string $description = null;
|
|
|
|
#[ORM\Column]
|
|
#[Assert\NotNull(message: 'required')]
|
|
private ?int $price = null;
|
|
|
|
#[ORM\Column(type: Types::DATE_IMMUTABLE)]
|
|
#[Assert\NotNull(message: 'required')]
|
|
private ?\DateTimeImmutable $dateFrom = null;
|
|
|
|
#[ORM\Column(type: Types::DATE_IMMUTABLE)]
|
|
#[Assert\NotNull(message: 'required')]
|
|
private ?\DateTimeImmutable $dateTo = null;
|
|
|
|
public function __clone()
|
|
{
|
|
$this->id = null;
|
|
}
|
|
|
|
public function getId(): ?int
|
|
{
|
|
return $this->id;
|
|
}
|
|
|
|
public function getAccommodation(): ?Accommodation
|
|
{
|
|
return $this->accommodation;
|
|
}
|
|
|
|
public function setAccommodation(?Accommodation $accommodation): self
|
|
{
|
|
$this->accommodation = $accommodation;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getLabel(): ?string
|
|
{
|
|
return $this->label;
|
|
}
|
|
|
|
public function setLabel(string $label): self
|
|
{
|
|
$this->label = $label;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getDescription(): ?string
|
|
{
|
|
return $this->description;
|
|
}
|
|
|
|
public function setDescription(?string $description): self
|
|
{
|
|
$this->description = $description;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getPrice(): ?int
|
|
{
|
|
return $this->price;
|
|
}
|
|
|
|
public function setPrice(int $price): self
|
|
{
|
|
$this->price = $price;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getDateFrom(): ?\DateTimeImmutable
|
|
{
|
|
return $this->dateFrom;
|
|
}
|
|
|
|
public function setDateFrom(\DateTimeImmutable $dateFrom): self
|
|
{
|
|
$this->dateFrom = $dateFrom;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getDateTo(): ?\DateTimeImmutable
|
|
{
|
|
return $this->dateTo;
|
|
}
|
|
|
|
public function setDateTo(\DateTimeImmutable $dateTo): self
|
|
{
|
|
$this->dateTo = $dateTo;
|
|
|
|
return $this;
|
|
}
|
|
}
|