src/Entity/Reservation.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ReservationRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=ReservationRepository::class)
  9.  */
  10. class Reservation
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="datetime")
  20.      */
  21.     private $reservationPlannedAt;
  22.     /**
  23.      * @ORM\Column(type="string", length=255, nullable=true)
  24.      */
  25.     private $payinId;
  26.     /**
  27.      * @ORM\Column(type="datetime")
  28.      */
  29.     private $createdAt;
  30.     /**
  31.      * @ORM\Column(type="datetime")
  32.      */
  33.     private $updatedAt;
  34.     /**
  35.      * @ORM\Column(type="boolean", nullable=true)
  36.      */
  37.     private $isAccepted;
  38.     /**
  39.      * @ORM\Column(type="text", nullable=true)
  40.      */
  41.     private $raisonRefus;
  42.     /**
  43.      * @ORM\ManyToOne(targetEntity=User::class, inversedBy="reservations")
  44.      * @ORM\JoinColumn(nullable=false)
  45.      */
  46.     private $client;
  47.     /**
  48.      * @ORM\ManyToOne(targetEntity=Product::class, inversedBy="reservations")
  49.      * @ORM\JoinColumn(nullable=false)
  50.      */
  51.     private $product;
  52.     /**
  53.      * @ORM\Column(type="integer", nullable=true)
  54.      */
  55.     private $quantity;
  56.     /**
  57.      * @ORM\Column(type="boolean")
  58.      */
  59.     private $isReceived;
  60.     /**
  61.      * @ORM\Column(type="string", length=255, nullable=true)
  62.      */
  63.     private $trackingCode;
  64.     /**
  65.      * @ORM\Column(type="array", nullable=true)
  66.      */
  67.     private $options = [];
  68.     /**
  69.      * @ORM\Column(type="float", nullable=true)
  70.      */
  71.     private $promo;
  72.     /**
  73.      * @ORM\Column(type="string", length=255, nullable=true)
  74.      */
  75.     private $address;
  76.     /**
  77.      * @ORM\Column(type="string", length=255, nullable=true)
  78.      */
  79.     private $postalCode;
  80.     /**
  81.      * @ORM\Column(type="string", length=255, nullable=true)
  82.      */
  83.     private $city;
  84.     /**
  85.      * @ORM\Column(type="string", length=255, nullable=true)
  86.      */
  87.     private $color;
  88.     /**
  89.      * @ORM\Column(type="string", length=255, nullable=true)
  90.      */
  91.     private $size;
  92.     /**
  93.      * @ORM\Column(type="integer", nullable=true)
  94.      */
  95.     private $nbGuests;
  96.     /**
  97.      * @ORM\Column(type="float", nullable=true)
  98.      */
  99.     private $totalAmount;
  100.     /**
  101.      * @ORM\Column(type="array", nullable=true)
  102.      */
  103.     private $groupOptions = [];
  104.     /**
  105.      * @ORM\OneToMany(targetEntity=Transfert::class, mappedBy="reservation")
  106.      */
  107.     private $transferts;
  108.     /**
  109.      * @ORM\OneToMany(targetEntity=AppFee::class, mappedBy="reservation")
  110.      */
  111.     private $appFees;
  112.     public function __construct()
  113.     {
  114.         $this->transferts = new ArrayCollection();
  115.         $this->appFees = new ArrayCollection();
  116.     }
  117.     public function getId(): ?int
  118.     {
  119.         return $this->id;
  120.     }
  121.     public function getReservationPlannedAt(): ?\DateTimeInterface
  122.     {
  123.         return $this->reservationPlannedAt;
  124.     }
  125.     public function setReservationPlannedAt(\DateTimeInterface $reservationPlannedAt): self
  126.     {
  127.         $this->reservationPlannedAt $reservationPlannedAt;
  128.         return $this;
  129.     }
  130.     public function getPayinId(): ?string
  131.     {
  132.         return $this->payinId;
  133.     }
  134.     public function setPayinId(string $payinId): self
  135.     {
  136.         $this->payinId $payinId;
  137.         return $this;
  138.     }
  139.     public function getCreatedAt(): ?\DateTimeInterface
  140.     {
  141.         return $this->createdAt;
  142.     }
  143.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  144.     {
  145.         $this->createdAt $createdAt;
  146.         return $this;
  147.     }
  148.     public function getUpdatedAt(): ?\DateTimeInterface
  149.     {
  150.         return $this->updatedAt;
  151.     }
  152.     public function setUpdatedAt(\DateTimeInterface $updatedAt): self
  153.     {
  154.         $this->updatedAt $updatedAt;
  155.         return $this;
  156.     }
  157.     public function getIsAccepted(): ?bool
  158.     {
  159.         return $this->isAccepted;
  160.     }
  161.     public function setIsAccepted(?bool $isAccepted): self
  162.     {
  163.         $this->isAccepted $isAccepted;
  164.         return $this;
  165.     }
  166.     public function getRaisonRefus(): ?string
  167.     {
  168.         return $this->raisonRefus;
  169.     }
  170.     public function setRaisonRefus(?string $raisonRefus): self
  171.     {
  172.         $this->raisonRefus $raisonRefus;
  173.         return $this;
  174.     }
  175.     public function getClient(): ?User
  176.     {
  177.         return $this->client;
  178.     }
  179.     public function setClient(?User $client): self
  180.     {
  181.         $this->client $client;
  182.         return $this;
  183.     }
  184.     public function getProduct(): ?Product
  185.     {
  186.         return $this->product;
  187.     }
  188.     public function setProduct(?Product $product): self
  189.     {
  190.         $this->product $product;
  191.         return $this;
  192.     }
  193.     public function getQuantity(): ?int
  194.     {
  195.         return $this->quantity;
  196.     }
  197.     public function setQuantity(?int $quantity): self
  198.     {
  199.         $this->quantity $quantity;
  200.         return $this;
  201.     }
  202.     public function getIsReceived(): ?bool
  203.     {
  204.         return $this->isReceived;
  205.     }
  206.     public function setIsReceived(bool $isReceived): self
  207.     {
  208.         $this->isReceived $isReceived;
  209.         return $this;
  210.     }
  211.     public function getTrackingCode(): ?string
  212.     {
  213.         return $this->trackingCode;
  214.     }
  215.     public function setTrackingCode(?string $trackingCode): self
  216.     {
  217.         $this->trackingCode $trackingCode;
  218.         return $this;
  219.     }
  220.     public function getOptions(): ?array
  221.     {
  222.         return $this->options;
  223.     }
  224.     public function setOptions(?array $options): self
  225.     {
  226.         $this->options $options;
  227.         return $this;
  228.     }
  229.     public function getPromo(): ?float
  230.     {
  231.         return $this->promo;
  232.     }
  233.     public function setPromo(?float $promo): self
  234.     {
  235.         $this->promo $promo;
  236.         return $this;
  237.     }
  238.     public function getAddress(): ?string
  239.     {
  240.         return $this->address;
  241.     }
  242.     public function setAddress(?string $address): self
  243.     {
  244.         $this->address $address;
  245.         return $this;
  246.     }
  247.     public function getPostalCode(): ?string
  248.     {
  249.         return $this->postalCode;
  250.     }
  251.     public function setPostalCode(?string $postalCode): self
  252.     {
  253.         $this->postalCode $postalCode;
  254.         return $this;
  255.     }
  256.     public function getCity(): ?string
  257.     {
  258.         return $this->city;
  259.     }
  260.     public function setCity(?string $city): self
  261.     {
  262.         $this->city $city;
  263.         return $this;
  264.     }
  265.     public function getColor(): ?string
  266.     {
  267.         return $this->color;
  268.     }
  269.     public function setColor(?string $color): self
  270.     {
  271.         $this->color $color;
  272.         return $this;
  273.     }
  274.     public function getSize(): ?string
  275.     {
  276.         return $this->size;
  277.     }
  278.     public function setSize(?string $size): self
  279.     {
  280.         $this->size $size;
  281.         return $this;
  282.     }
  283.     public function getNbGuests(): ?int
  284.     {
  285.         return $this->nbGuests;
  286.     }
  287.     public function setNbGuests(?int $nbGuests): self
  288.     {
  289.         $this->nbGuests $nbGuests;
  290.         return $this;
  291.     }
  292.     public function getTotalAmount(): ?float
  293.     {
  294.         return $this->totalAmount;
  295.     }
  296.     public function setTotalAmount(?float $totalAmount): self
  297.     {
  298.         $this->totalAmount $totalAmount;
  299.         return $this;
  300.     }
  301.     public function getGroupOptions(): ?array
  302.     {
  303.         return $this->groupOptions;
  304.     }
  305.     public function setGroupOptions(?array $groupOptions): self
  306.     {
  307.         $this->groupOptions $groupOptions;
  308.         return $this;
  309.     }
  310.     /**
  311.      * @return Collection<int, Transfert>
  312.      */
  313.     public function getTransferts(): Collection
  314.     {
  315.         return $this->transferts;
  316.     }
  317.     public function addTransfert(Transfert $transfert): self
  318.     {
  319.         if (!$this->transferts->contains($transfert)) {
  320.             $this->transferts[] = $transfert;
  321.             $transfert->setReservation($this);
  322.         }
  323.         return $this;
  324.     }
  325.     public function removeTransfert(Transfert $transfert): self
  326.     {
  327.         if ($this->transferts->removeElement($transfert)) {
  328.             // set the owning side to null (unless already changed)
  329.             if ($transfert->getReservation() === $this) {
  330.                 $transfert->setReservation(null);
  331.             }
  332.         }
  333.         return $this;
  334.     }
  335.     /**
  336.      * @return Collection<int, AppFee>
  337.      */
  338.     public function getAppFees(): Collection
  339.     {
  340.         return $this->appFees;
  341.     }
  342.     public function addAppFee(AppFee $appFee): self
  343.     {
  344.         if (!$this->appFees->contains($appFee)) {
  345.             $this->appFees[] = $appFee;
  346.             $appFee->setReservation($this);
  347.         }
  348.         return $this;
  349.     }
  350.     public function removeAppFee(AppFee $appFee): self
  351.     {
  352.         if ($this->appFees->removeElement($appFee)) {
  353.             // set the owning side to null (unless already changed)
  354.             if ($appFee->getReservation() === $this) {
  355.                 $appFee->setReservation(null);
  356.             }
  357.         }
  358.         return $this;
  359.     }
  360. }