<?php
namespace App\Entity;
use App\Repository\ReservationRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=ReservationRepository::class)
*/
class Reservation
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="datetime")
*/
private $reservationPlannedAt;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $payinId;
/**
* @ORM\Column(type="datetime")
*/
private $createdAt;
/**
* @ORM\Column(type="datetime")
*/
private $updatedAt;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $isAccepted;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $raisonRefus;
/**
* @ORM\ManyToOne(targetEntity=User::class, inversedBy="reservations")
* @ORM\JoinColumn(nullable=false)
*/
private $client;
/**
* @ORM\ManyToOne(targetEntity=Product::class, inversedBy="reservations")
* @ORM\JoinColumn(nullable=false)
*/
private $product;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $quantity;
/**
* @ORM\Column(type="boolean")
*/
private $isReceived;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $trackingCode;
/**
* @ORM\Column(type="array", nullable=true)
*/
private $options = [];
/**
* @ORM\Column(type="float", nullable=true)
*/
private $promo;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $address;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $postalCode;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $city;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $color;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $size;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $nbGuests;
/**
* @ORM\Column(type="float", nullable=true)
*/
private $totalAmount;
/**
* @ORM\Column(type="array", nullable=true)
*/
private $groupOptions = [];
/**
* @ORM\OneToMany(targetEntity=Transfert::class, mappedBy="reservation")
*/
private $transferts;
/**
* @ORM\OneToMany(targetEntity=AppFee::class, mappedBy="reservation")
*/
private $appFees;
public function __construct()
{
$this->transferts = new ArrayCollection();
$this->appFees = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getReservationPlannedAt(): ?\DateTimeInterface
{
return $this->reservationPlannedAt;
}
public function setReservationPlannedAt(\DateTimeInterface $reservationPlannedAt): self
{
$this->reservationPlannedAt = $reservationPlannedAt;
return $this;
}
public function getPayinId(): ?string
{
return $this->payinId;
}
public function setPayinId(string $payinId): self
{
$this->payinId = $payinId;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(\DateTimeInterface $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updatedAt;
}
public function setUpdatedAt(\DateTimeInterface $updatedAt): self
{
$this->updatedAt = $updatedAt;
return $this;
}
public function getIsAccepted(): ?bool
{
return $this->isAccepted;
}
public function setIsAccepted(?bool $isAccepted): self
{
$this->isAccepted = $isAccepted;
return $this;
}
public function getRaisonRefus(): ?string
{
return $this->raisonRefus;
}
public function setRaisonRefus(?string $raisonRefus): self
{
$this->raisonRefus = $raisonRefus;
return $this;
}
public function getClient(): ?User
{
return $this->client;
}
public function setClient(?User $client): self
{
$this->client = $client;
return $this;
}
public function getProduct(): ?Product
{
return $this->product;
}
public function setProduct(?Product $product): self
{
$this->product = $product;
return $this;
}
public function getQuantity(): ?int
{
return $this->quantity;
}
public function setQuantity(?int $quantity): self
{
$this->quantity = $quantity;
return $this;
}
public function getIsReceived(): ?bool
{
return $this->isReceived;
}
public function setIsReceived(bool $isReceived): self
{
$this->isReceived = $isReceived;
return $this;
}
public function getTrackingCode(): ?string
{
return $this->trackingCode;
}
public function setTrackingCode(?string $trackingCode): self
{
$this->trackingCode = $trackingCode;
return $this;
}
public function getOptions(): ?array
{
return $this->options;
}
public function setOptions(?array $options): self
{
$this->options = $options;
return $this;
}
public function getPromo(): ?float
{
return $this->promo;
}
public function setPromo(?float $promo): self
{
$this->promo = $promo;
return $this;
}
public function getAddress(): ?string
{
return $this->address;
}
public function setAddress(?string $address): self
{
$this->address = $address;
return $this;
}
public function getPostalCode(): ?string
{
return $this->postalCode;
}
public function setPostalCode(?string $postalCode): self
{
$this->postalCode = $postalCode;
return $this;
}
public function getCity(): ?string
{
return $this->city;
}
public function setCity(?string $city): self
{
$this->city = $city;
return $this;
}
public function getColor(): ?string
{
return $this->color;
}
public function setColor(?string $color): self
{
$this->color = $color;
return $this;
}
public function getSize(): ?string
{
return $this->size;
}
public function setSize(?string $size): self
{
$this->size = $size;
return $this;
}
public function getNbGuests(): ?int
{
return $this->nbGuests;
}
public function setNbGuests(?int $nbGuests): self
{
$this->nbGuests = $nbGuests;
return $this;
}
public function getTotalAmount(): ?float
{
return $this->totalAmount;
}
public function setTotalAmount(?float $totalAmount): self
{
$this->totalAmount = $totalAmount;
return $this;
}
public function getGroupOptions(): ?array
{
return $this->groupOptions;
}
public function setGroupOptions(?array $groupOptions): self
{
$this->groupOptions = $groupOptions;
return $this;
}
/**
* @return Collection<int, Transfert>
*/
public function getTransferts(): Collection
{
return $this->transferts;
}
public function addTransfert(Transfert $transfert): self
{
if (!$this->transferts->contains($transfert)) {
$this->transferts[] = $transfert;
$transfert->setReservation($this);
}
return $this;
}
public function removeTransfert(Transfert $transfert): self
{
if ($this->transferts->removeElement($transfert)) {
// set the owning side to null (unless already changed)
if ($transfert->getReservation() === $this) {
$transfert->setReservation(null);
}
}
return $this;
}
/**
* @return Collection<int, AppFee>
*/
public function getAppFees(): Collection
{
return $this->appFees;
}
public function addAppFee(AppFee $appFee): self
{
if (!$this->appFees->contains($appFee)) {
$this->appFees[] = $appFee;
$appFee->setReservation($this);
}
return $this;
}
public function removeAppFee(AppFee $appFee): self
{
if ($this->appFees->removeElement($appFee)) {
// set the owning side to null (unless already changed)
if ($appFee->getReservation() === $this) {
$appFee->setReservation(null);
}
}
return $this;
}
}