<?php
namespace App\Entity;
use App\MDS\EventsBundle\Entity\Proposal;
use App\MDS\GreenPatioBundle\Entity\Reservation;
use App\Repository\HtFileRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=HtFileRepository::class)
* @ORM\HasLifecycleCallbacks()
*/
class HtFile
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity=Client::class)
*/
private $client;
/**
* @ORM\ManyToOne(targetEntity=Proposal::class)
*/
private $proposal;
/**
* @ORM\ManyToOne(targetEntity=User::class)
* @ORM\JoinColumn(nullable=false)
*/
private $createdId;
/**
* @ORM\ManyToOne(targetEntity=User::class)
* @ORM\JoinColumn(nullable=false)
*/
private $updatedId;
/**
* @ORM\Column(type="string", length=255)
*/
private $title;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $status;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $daysBlock;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $pax;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $description;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $descriptionTwo;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $contactUnregistered;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $nameContactUnregistered;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $phoneContactUnregistered;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $dateStart;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $dateEnd;
/**
* @ORM\Column(type="datetime_immutable")
*/
private $createdAt;
/**
* @ORM\Column(type="datetime_immutable")
*/
private $updatedAt;
/**
* @ORM\ManyToOne(targetEntity=ClientContact::class)
*/
private $clientContact;
/**
* @ORM\OneToOne(targetEntity=Reservation::class, inversedBy="htFile", cascade={"persist", "remove"})
*/
private $reservation;
/**
* @ORM\OneToMany(targetEntity=HtItem::class, mappedBy="htFile", orphanRemoval=true)
*/
private $htItems;
/**
* @ORM\OneToMany(targetEntity=HtVisit::class, mappedBy="reservation")
*/
private $htVisits;
public function __construct()
{
$this->htItems = new ArrayCollection();
$this->htVisits = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getClient(): ?Client
{
return $this->client;
}
public function setClient(?Client $client): self
{
$this->client = $client;
return $this;
}
public function getProposal(): ?Proposal
{
return $this->proposal;
}
public function setProposal(?Proposal $proposal): self
{
$this->proposal = $proposal;
return $this;
}
public function getCreatedId(): ?User
{
return $this->createdId;
}
public function setCreatedId(?User $createdId): self
{
$this->createdId = $createdId;
return $this;
}
public function getUpdatedId(): ?User
{
return $this->updatedId;
}
public function setUpdatedId(?User $updatedId): self
{
$this->updatedId = $updatedId;
return $this;
}
public function getTitle(): ?string
{
return $this->title;
}
public function setTitle(string $title): self
{
$this->title = $title;
return $this;
}
public function getStatus(): ?string
{
return $this->status;
}
public function setStatus(?string $status): self
{
$this->status = $status;
return $this;
}
public function getDaysBlock(): ?int
{
return $this->daysBlock;
}
public function setDaysBlock(?int $daysBlock): self
{
$this->daysBlock = $daysBlock;
return $this;
}
public function getPax(): ?int
{
return $this->pax;
}
public function setPax(?int $pax): self
{
$this->pax = $pax;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
public function getDescriptionTwo(): ?string
{
return $this->descriptionTwo;
}
public function setDescriptionTwo(?string $descriptionTwo): self
{
$this->descriptionTwo = $descriptionTwo;
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 getDateStart(): ?\DateTime
{
return $this->dateStart;
}
public function setDateStart(?\DateTime $dateStart): self
{
$this->dateStart = $dateStart;
return $this;
}
public function getDateEnd(): ?\DateTime
{
return $this->dateEnd;
}
public function setDateEnd(?\DateTime $dateEnd): self
{
$this->dateEnd = $dateEnd;
return $this;
}
public function getCreatedAt(): ?\DateTimeImmutable
{
return $this->createdAt;
}
public function setCreatedAt(\DateTimeImmutable $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function getUpdatedAt(): ?\DateTimeImmutable
{
return $this->updatedAt;
}
public function setUpdatedAt(\DateTimeImmutable $updatedAt): self
{
$this->updatedAt = $updatedAt;
return $this;
}
/**
* @ORM\PrePersist
*/
public function setCreatedAtValue()
{
$this->createdAt = new \DateTimeImmutable();
}
/**
* @ORM\PrePersist
* @ORM\PreUpdate
*/
public function setUpdatedAtValue()
{
$this->updatedAt = new \DateTimeImmutable();
}
public function getClientContact(): ?ClientContact
{
return $this->clientContact;
}
public function setClientContact(?ClientContact $clientContact): self
{
$this->clientContact = $clientContact;
return $this;
}
public function getReservation(): ?Reservation
{
return $this->reservation;
}
public function setReservation(?Reservation $reservation): self
{
$this->reservation = $reservation;
return $this;
}
/**
* @return Collection<int, HtItem>
*/
public function getHtItems(): Collection
{
return $this->htItems;
}
public function addHtItem(HtItem $htItem): self
{
if (!$this->htItems->contains($htItem)) {
$this->htItems[] = $htItem;
$htItem->setHtFile($this);
}
return $this;
}
public function removeHtItem(HtItem $htItem): self
{
if ($this->htItems->removeElement($htItem)) {
// set the owning side to null (unless already changed)
if ($htItem->getHtFile() === $this) {
$htItem->setHtFile(null);
}
}
return $this;
}
/**
* @return Collection<int, HtVisit>
*/
public function getHtVisits(): Collection
{
return $this->htVisits;
}
public function addHtVisit(HtVisit $htVisit): self
{
if (!$this->htVisits->contains($htVisit)) {
$this->htVisits[] = $htVisit;
$htVisit->setReservation($this);
}
return $this;
}
public function removeHtVisit(HtVisit $htVisit): self
{
if ($this->htVisits->removeElement($htVisit)) {
// set the owning side to null (unless already changed)
if ($htVisit->getReservation() === $this) {
$htVisit->setReservation(null);
}
}
return $this;
}
}