<?php
namespace App\MDS\VenuesBundle\Entity;
use App\Entity\GpReminder;
use App\Entity\Client;
use App\Entity\HtFile;
use App\MDS\AvexpressBundle\Entity\AveFiles;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use Symfony\Component\Serializer\Annotation\Ignore;
//use Doctrine\Common\Collections\ArrayCollection;
//use Doctrine\Common\Collections\Collection;
/**
* Reservation
*
* @ORM\Table(name="reservation")
* @ORM\Entity(repositoryClass="App\MDS\VenuesBundle\Repository\ReservationRepository")
* @ORM\HasLifecycleCallbacks
*/
class Reservation
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var string
*
* @ORM\Column(name="title", type="string", length=255)
* @Assert\NotBlank
*/
private $title;
/**
* @ORM\ManyToOne(targetEntity=Client::class)
* @ORM\JoinColumn(name="client_id", referencedColumnName="id", nullable=true, onDelete="SET NULL")
*/
private ?Client $client = null;
/**
* @var string
*
* @ORM\Column(name="clientContact", type="string", length=255, nullable=true )
*
*/
private $clientContact;
/**
* @var string
*
* @ORM\Column(name="contactUnregistered", type="string", length=255, nullable=true )
*
*/
private $contactUnregistered;
/**
* @var string
*
* @ORM\Column(name="nameContactUnregistered", type="string", length=255, nullable=true )
*
*/
private $nameContactUnregistered;
/**
* @var string
*
* @ORM\Column(name="phoneContactUnregistered", type="string", length=255, nullable=true )
*
*/
private $phoneContactUnregistered;
/**
* @var \DateTimeInterface|null
*
* @ORM\Column(name="days", type="datetime", nullable=true)
*/
private $days;
/**
* @var \DateTime
*
* @ORM\Column(name="createdAt", type="datetime")
*/
private $createdAt;
/**
* @var string
*
* @ORM\Column(name="priority", type="string", length=255)
*/
private $priority;
/**
* @var string
*
* @ORM\Column(name="createdBy", type="string", length=255)
*/
private $createdBy;
/**
* @var string
*
* @ORM\Column(name="supplier", type="string", length=255, nullable=true)
*/
private $supplier;
/**
* @var string
*
* @ORM\Column(name="status", type="string", length=255, nullable=true)
*/
private $status;
/**
* @var \DateTime
*
* @ORM\Column(name="updatedAt", type="datetime")
*/
private $updatedAt;
/**
* @var string
*
* @ORM\Column(name="updatedBy", type="string", length=255)
*/
private $updatedBy;
/**
* @var int
*
* @ORM\Column(name="daysBlock", type="integer", nullable=true)
*/
private $daysBlock;
/**
* @var \DateTime
*
* @ORM\Column(name="dateStart", type="datetime", nullable=true)
*/
private $dateStart;
/**
* @var \DateTime
*
* @ORM\Column(name="dateEnd", type="datetime", nullable=true)
*/
private $dateEnd;
/**
* @var int
*
* @ORM\Column(name="pax", type="integer", nullable=true)
*/
private $pax;
/**
* @var string
*
* @ORM\Column(name="access_key", type="string", length=255, nullable=true)
*/
private $accessKey;
/**
* @var string
*
* @ORM\Column(name="description", type="text", nullable=true)
*/
private $description;
/**
* @var string
*
* @ORM\Column(name="contract", type="text", nullable=true)
*/
private $contract;
/**
* @ORM\OneToOne(targetEntity=HtFile::class, mappedBy="reservation", cascade={"persist", "remove"})
* @Ignore
*/
private $htFile;
/**
* @ORM\OneToOne(targetEntity=AveFiles::class, mappedBy="reservation", cascade={"persist","remove"})
*/
private ?AveFiles $aveFile = null;
/**
* @var string
*
* @ORM\Column(name="token", type="text", nullable=true)
*/
private $token;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $sucoe;
public function getId(): ?int
{
return $this->id;
}
public function getTitle(): ?string
{
return $this->title;
}
public function setTitle(string $title): self
{
$this->title = $title;
return $this;
}
public function getClient(): ?Client
{
return $this->client;
}
public function setClient(?Client $client): self
{
$this->client = $client;
return $this;
}
public function getClientContact(): ?string
{
return $this->clientContact;
}
public function setClientContact(?string $clientContact): self
{
$this->clientContact = $clientContact;
return $this;
}
public function getContactUnregistered(): ?string
{
return $this->contactUnregistered;
}
public function setContactUnregistered(?string $contactUnregistered): self
{
$this->contactUnregistered = $contactUnregistered;
return $this;
}
public function getNameContactUnregistered(): ?string
{
return $this->nameContactUnregistered;
}
public function setNameContactUnregistered(?string $nameContactUnregistered): self
{
$this->nameContactUnregistered = $nameContactUnregistered;
return $this;
}
public function getPhoneContactUnregistered(): ?string
{
return $this->phoneContactUnregistered;
}
public function setPhoneContactUnregistered(?string $phoneContactUnregistered): self
{
$this->phoneContactUnregistered = $phoneContactUnregistered;
return $this;
}
public function getDays(): ?\DateTimeInterface
{
return $this->days;
}
public function setDays(?\DateTimeInterface $days): self
{
$this->days = $days;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(\DateTimeInterface $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function getPriority(): ?string
{
return $this->priority;
}
public function setPriority(string $priority): self
{
$this->priority = $priority;
return $this;
}
public function getCreatedBy(): ?string
{
return $this->createdBy;
}
public function setCreatedBy(string $createdBy): self
{
$this->createdBy = $createdBy;
return $this;
}
public function getSupplier(): ?string
{
return $this->supplier;
}
public function setSupplier(?string $supplier): self
{
$this->supplier = $supplier;
return $this;
}
public function getStatus(): ?string
{
return $this->status;
}
public function setStatus(?string $status): self
{
$this->status = $status;
return $this;
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updatedAt;
}
public function setUpdatedAt(\DateTimeInterface $updatedAt): self
{
$this->updatedAt = $updatedAt;
return $this;
}
public function getUpdatedBy(): ?string
{
return $this->updatedBy;
}
public function setUpdatedBy(string $updatedBy): self
{
$this->updatedBy = $updatedBy;
return $this;
}
public function getDaysBlock(): ?int
{
return $this->daysBlock;
}
public function setDaysBlock(?int $daysBlock): self
{
$this->daysBlock = $daysBlock;
return $this;
}
public function getDateStart(): ?\DateTimeInterface
{
return $this->dateStart;
}
public function setDateStart(?\DateTimeInterface $dateStart): self
{
$this->dateStart = $dateStart;
return $this;
}
public function getDateEnd(): ?\DateTimeInterface
{
return $this->dateEnd;
}
public function setDateEnd(?\DateTimeInterface $dateEnd): self
{
$this->dateEnd = $dateEnd;
return $this;
}
public function getPax(): ?int
{
return $this->pax;
}
public function setPax(?int $pax): self
{
$this->pax = $pax;
return $this;
}
public function getAccessKey(): ?string
{
return $this->accessKey;
}
public function setAccessKey(?string $accessKey): self
{
$this->accessKey = $accessKey;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
public function getContract(): ?string
{
return $this->contract;
}
public function setContract(?string $contract): self
{
$this->contract = $contract;
return $this;
}
public function getHtFile(): ?HtFile
{
return $this->htFile;
}
public function setHtFile(?HtFile $htFile): self
{
// unset the owning side of the relation if necessary
if ($htFile === null && $this->htFile !== null) {
$this->htFile->setReservation(null);
}
// set the owning side of the relation if necessary
if ($htFile !== null && $htFile->getReservation() !== $this) {
$htFile->setReservation($this);
}
$this->htFile = $htFile;
return $this;
}
public function getAveFile(): ?AveFiles
{
return $this->aveFile;
}
public function setAveFile(?AveFiles $aveFile): self
{
$this->aveFile = $aveFile;
// Mantener sincronizada la otra cara
if ($aveFile && $aveFile->getReservation() !== $this) {
$aveFile->setReservation($this);
}
return $this;
}
public function getToken(): ?string
{
return $this->token;
}
public function setToken(?string $token): self
{
$this->token = $token;
return $this;
}
public function isSucoe(): ?bool
{
return $this->sucoe;
}
public function setSucoe(?bool $sucoe): self
{
$this->sucoe = $sucoe;
return $this;
}
/**
* @ORM\PrePersist
*/
public function prePersist()
{
if (empty($this->createdAt)) {
$this->createdAt = new \DateTime();
}
if (empty($this->updatedAt)) {
$this->updatedAt = new \DateTime();
}
}
/**
* @ORM\PreUpdate
*/
public function preUpdate()
{
$this->updatedAt = new \DateTime();
}
}