src/MDS/GreenPatioBundle/Entity/Reservation.php line 21

Open in your IDE?
  1. <?php
  2. namespace App\MDS\GreenPatioBundle\Entity;
  3. use App\Entity\GpReminder;
  4. use App\Entity\HtFile;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use Symfony\Component\Validator\Constraints as Assert;
  9. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  10. use Symfony\Component\Serializer\Annotation\Ignore;
  11. /**
  12.  * Reservation
  13.  *
  14.  * @ORM\Table(name="reservation")
  15.  * @ORM\Entity(repositoryClass="App\MDS\GreenPatioBundle\Repository\ReservationRepository")
  16.  */
  17. class Reservation
  18. {
  19.     /**
  20.      * @var int
  21.      *
  22.      * @ORM\Column(name="id", type="integer")
  23.      * @ORM\Id
  24.      * @ORM\GeneratedValue(strategy="AUTO")
  25.      */
  26.     private $id;
  27.     /**
  28.      * @var string
  29.      *
  30.      * @ORM\Column(name="title", type="string", length=255)
  31.      * @Assert\NotBlank
  32.      */
  33.     private $title;
  34.     /**
  35.      * @var string
  36.      *
  37.      * @ORM\Column(name="client", type="string", length=255, nullable=true )
  38.      *
  39.      */
  40.     private $client;
  41.     /**
  42.      * @var string
  43.      *
  44.      * @ORM\Column(name="clientContact", type="string", length=255, nullable=true )
  45.      *
  46.      */
  47.     private $clientContact;
  48.     /**
  49.      * @var string
  50.      *
  51.      * @ORM\Column(name="contactUnregistered", type="string", length=255, nullable=true )
  52.      *
  53.      */
  54.     private $contactUnregistered;
  55.     /**
  56.      * @var string
  57.      *
  58.      * @ORM\Column(name="nameContactUnregistered", type="string", length=255, nullable=true )
  59.      *
  60.      */
  61.     private $nameContactUnregistered;
  62.     /**
  63.      * @var string
  64.      *
  65.      * @ORM\Column(name="phoneContactUnregistered", type="string", length=255, nullable=true )
  66.      *
  67.      */
  68.     private $phoneContactUnregistered;
  69.     /**
  70.      * @var \DateTimeInterface|null
  71.      *
  72.      * @ORM\Column(name="days", type="datetime", nullable=true)
  73.      */
  74.     private $days;
  75.     /**
  76.      * @var \DateTime
  77.      *
  78.      * @ORM\Column(name="createdAt", type="datetime")
  79.      */
  80.     private $createdAt;
  81.     /**
  82.      * @var string
  83.      *
  84.      * @ORM\Column(name="priority", type="string", length=255)
  85.      */
  86.     private $priority;
  87.     /**
  88.      * @var string
  89.      *
  90.      * @ORM\Column(name="createdBy", type="string", length=255)
  91.      */
  92.     private $createdBy;
  93.     /**
  94.      * @var string
  95.      *
  96.      * @ORM\Column(name="supplier", type="string", length=255, nullable=true)
  97.      */
  98.     private $supplier;
  99.     /**
  100.      * @var string
  101.      *
  102.      * @ORM\Column(name="status", type="string", length=255, nullable=true)
  103.      */
  104.     private $status;
  105.     /**
  106.      * @var \DateTime
  107.      *
  108.      * @ORM\Column(name="updatedAt", type="datetime")
  109.      */
  110.     private $updatedAt;
  111.     /**
  112.      * @var string
  113.      *
  114.      * @ORM\Column(name="updatedBy", type="string", length=255)
  115.      */
  116.     private $updatedBy;
  117.     /**
  118.      * @var int
  119.      *
  120.      * @ORM\Column(name="daysBlock", type="integer", nullable=true)
  121.      */
  122.     private $daysBlock;
  123.     /**
  124.      * @var string
  125.      *
  126.      * @ORM\Column(name="advancePayment", type="string", length=255, nullable=true)
  127.      */
  128.     private $advancePayment;
  129.     /**
  130.      * @var int
  131.      *
  132.      * @ORM\Column(name="idProposal", type="integer", nullable=true)
  133.      */
  134.     private $idProposal;
  135.     /**
  136.      * @var string
  137.      *
  138.      * @ORM\Column(name="cateringName", type="string", length=255, nullable=true)
  139.      */
  140.     private $cateringName;
  141.     /**
  142.      * @var string
  143.      *
  144.      * @ORM\Column(name="boolCatering", type="boolean", nullable=true)
  145.      */
  146.     private $boolCatering;
  147.     /**
  148.      * @var \DateTime
  149.      *
  150.      * @ORM\Column(name="dateStart", type="datetime", nullable=true)
  151.      */
  152.     private $dateStart;
  153.     /**
  154.      * @var \DateTime
  155.      *
  156.      * @ORM\Column(name="dateEnd", type="datetime", nullable=true)
  157.      */
  158.     private $dateEnd;
  159.     /**
  160.      * @var int
  161.      *
  162.      * @ORM\Column(name="pax", type="integer", nullable=true)
  163.      */
  164.     private $pax;
  165.     /**
  166.      * @var int
  167.      *
  168.      * @ORM\Column(name="deposit", type="integer", nullable=true)
  169.      */
  170.     private $deposit;
  171.     /**
  172.      * @var string
  173.      *
  174.      * @ORM\Column(name="access_key", type="string", length=255, nullable=true)
  175.      */
  176.     private $accessKey;
  177.     /**
  178.      * @var string
  179.      *
  180.      * @ORM\Column(name="description", type="text", nullable=true)
  181.      */
  182.     private $description;
  183.     /**
  184.      * @var string
  185.      *
  186.      * @ORM\Column(name="contract", type="text", nullable=true)
  187.      */
  188.     private $contract;
  189.     /**
  190.      * @ORM\OneToOne(targetEntity=HtFile::class, mappedBy="reservation", cascade={"persist", "remove"})
  191.      * @Ignore
  192.      */
  193.     private $htFile;
  194.     /**
  195.      * @var string
  196.      *
  197.      * @ORM\Column(name="token", type="text", nullable=true)
  198.      */
  199.     private $token;
  200.     /**
  201.      * @ORM\OneToMany(targetEntity=GpReminder::class, mappedBy="reservation", orphanRemoval=true)
  202.      */
  203.     private $gpReminders;
  204.     /**
  205.      * @var float
  206.      *
  207.      * @ORM\Column(name="comAvGp", type="float", nullable=true)
  208.      * Comisión que AvExpress debe pagar a GrennPatio (10% por defecto)
  209.      */
  210.     private $comAvGp;
  211.     /**
  212.      * @var float
  213.      *
  214.      * @ORM\Column(name="comHtGp", type="float", nullable=true)
  215.      * Comisión que Higo&Trigo debe pagar a GrennPatio (14% por defecto)
  216.      */
  217.     private $comHtGp;
  218.     public function __construct()
  219.     {
  220.         $this->gpReminders = new ArrayCollection();
  221.     }
  222.     /**
  223.      * Get id
  224.      *
  225.      * @return int
  226.      */
  227.     public function getId()
  228.     {
  229.         return $this->id;
  230.     }
  231.     /**
  232.      * Set title
  233.      *
  234.      * @param string $title
  235.      *
  236.      * @return Reservation
  237.      */
  238.     public function setTitle($title)
  239.     {
  240.         $this->title $title;
  241.         return $this;
  242.     }
  243.     /**
  244.      * Get title
  245.      *
  246.      * @return string
  247.      */
  248.     public function getTitle()
  249.     {
  250.         return $this->title;
  251.     }
  252.     /**
  253.      * Set client
  254.      *
  255.      * @param string $client
  256.      *
  257.      * @return Reservation
  258.      */
  259.     public function setClient($client)
  260.     {
  261.         $this->client $client;
  262.         return $this;
  263.     }
  264.     /**
  265.      * Get client
  266.      *
  267.      * @return string
  268.      */
  269.     public function getClient()
  270.     {
  271.         return $this->client;
  272.     }
  273.     /**
  274.      * Set createdAt
  275.      *
  276.      * @param \DateTime $createdAt
  277.      *
  278.      * @return Reservation
  279.      */
  280.     public function setCreatedAt($createdAt)
  281.     {
  282.         $this->createdAt $createdAt;
  283.         return $this;
  284.     }
  285.     /**
  286.      * Get createdAt
  287.      *
  288.      * @return \DateTime
  289.      */
  290.     public function getCreatedAt()
  291.     {
  292.         return $this->createdAt;
  293.     }
  294.     /**
  295.      * Set priority
  296.      *
  297.      * @param string $priority
  298.      *
  299.      * @return Reservation
  300.      */
  301.     public function setPriority($priority)
  302.     {
  303.         $this->priority $priority;
  304.         return $this;
  305.     }
  306.     /**
  307.      * Get priority
  308.      *
  309.      * @return string
  310.      */
  311.     public function getPriority()
  312.     {
  313.         return $this->priority;
  314.     }
  315.     /**
  316.      * Set createdBy
  317.      *
  318.      * @param string $createdBy
  319.      *
  320.      * @return Reservation
  321.      */
  322.     public function setCreatedBy($createdBy)
  323.     {
  324.         $this->createdBy $createdBy;
  325.         return $this;
  326.     }
  327.     /**
  328.      * Get createdBy
  329.      *
  330.      * @return string
  331.      */
  332.     public function getCreatedBy()
  333.     {
  334.         return $this->createdBy;
  335.     }
  336.     /**
  337.      * Set supplier
  338.      *
  339.      * @param string $supplier
  340.      *
  341.      * @return Reservation
  342.      */
  343.     public function setSupplier($supplier)
  344.     {
  345.         $this->supplier $supplier;
  346.         return $this;
  347.     }
  348.     /**
  349.      * Get supplier
  350.      *
  351.      * @return string
  352.      */
  353.     public function getSupplier()
  354.     {
  355.         return $this->supplier;
  356.     }
  357.     /**
  358.      * Set status
  359.      *
  360.      * @param string $status
  361.      *
  362.      * @return Reservation
  363.      */
  364.     public function setStatus($status)
  365.     {
  366.         $this->status $status;
  367.         return $this;
  368.     }
  369.     /**
  370.      * Get status
  371.      *
  372.      * @return string
  373.      */
  374.     public function getStatus()
  375.     {
  376.         return $this->status;
  377.     }
  378.     /**
  379.      * Set updatedAt
  380.      *
  381.      * @param \DateTime $updatedAt
  382.      *
  383.      * @return Reservation
  384.      */
  385.     public function setUpdatedAt($updatedAt)
  386.     {
  387.         $this->updatedAt $updatedAt;
  388.         return $this;
  389.     }
  390.     /**
  391.      * Get updatedAt
  392.      *
  393.      * @return \DateTime
  394.      */
  395.     public function getUpdatedAt()
  396.     {
  397.         return $this->updatedAt;
  398.     }
  399.     /**
  400.      * Set updatedBy
  401.      *
  402.      * @param string $updatedBy
  403.      *
  404.      * @return Reservation
  405.      */
  406.     public function setUpdatedBy($updatedBy)
  407.     {
  408.         $this->updatedBy $updatedBy;
  409.         return $this;
  410.     }
  411.     /**
  412.      * Get updatedBy
  413.      *
  414.      * @return string
  415.      */
  416.     public function getUpdatedBy()
  417.     {
  418.         return $this->updatedBy;
  419.     }
  420.     /**
  421.      * Set daysBlock
  422.      *
  423.      * @param integer $daysBlock
  424.      *
  425.      * @return Reservation
  426.      */
  427.     public function setDaysBlock($daysBlock)
  428.     {
  429.         $this->daysBlock $daysBlock;
  430.         return $this;
  431.     }
  432.     /**
  433.      * Get daysBlock
  434.      *
  435.      * @return integer
  436.      */
  437.     public function getDaysBlock()
  438.     {
  439.         return $this->daysBlock;
  440.     }
  441.     /**
  442.      * Set advancePayment
  443.      *
  444.      * @param string $advancePayment
  445.      *
  446.      * @return Reservation
  447.      */
  448.     public function setAdvancePayment($advancePayment)
  449.     {
  450.         $this->advancePayment $advancePayment;
  451.         return $this;
  452.     }
  453.     /**
  454.      * Get advancePayment
  455.      *
  456.      * @return string
  457.      */
  458.     public function getAdvancePayment()
  459.     {
  460.         return $this->advancePayment;
  461.     }
  462.     /**
  463.      * Set idProposal
  464.      *
  465.      * @param integer $idProposal
  466.      *
  467.      * @return Reservation
  468.      */
  469.     public function setIdProposal($idProposal)
  470.     {
  471.         $this->idProposal $idProposal;
  472.         return $this;
  473.     }
  474.     /**
  475.      * Get idProposal
  476.      *
  477.      * @return integer
  478.      */
  479.     public function getIdProposal()
  480.     {
  481.         return $this->idProposal;
  482.     }
  483.     /**
  484.      * Set cateringName
  485.      *
  486.      * @param string $cateringName
  487.      *
  488.      * @return Reservation
  489.      */
  490.     public function setCateringName($cateringName)
  491.     {
  492.         $this->cateringName $cateringName;
  493.         return $this;
  494.     }
  495.     /**
  496.      * Get cateringName
  497.      *
  498.      * @return string
  499.      */
  500.     public function getCateringName()
  501.     {
  502.         return $this->cateringName;
  503.     }
  504.     /**
  505.      * Set boolCatering
  506.      *
  507.      * @param boolean $boolCatering
  508.      *
  509.      * @return Reservation
  510.      */
  511.     public function setBoolCatering($boolCatering)
  512.     {
  513.         $this->boolCatering $boolCatering;
  514.         return $this;
  515.     }
  516.     /**
  517.      * Get boolCatering
  518.      *
  519.      * @return boolean
  520.      */
  521.     public function getBoolCatering()
  522.     {
  523.         return $this->boolCatering;
  524.     }
  525.     /**
  526.      * Set dateStart
  527.      *
  528.      * @param \DateTime $dateStart
  529.      *
  530.      * @return Reservation
  531.      */
  532.     public function setDateStart($dateStart)
  533.     {
  534.         $this->dateStart $dateStart;
  535.         return $this;
  536.     }
  537.     /**
  538.      * Get dateStart
  539.      *
  540.      * @return \DateTime
  541.      */
  542.     public function getDateStart()
  543.     {
  544.         return $this->dateStart;
  545.     }
  546.     /**
  547.      * Set dateEnd
  548.      *
  549.      * @param \DateTime $dateEnd
  550.      *
  551.      * @return Reservation
  552.      */
  553.     public function setDateEnd($dateEnd)
  554.     {
  555.         $this->dateEnd $dateEnd;
  556.         return $this;
  557.     }
  558.     /**
  559.      * Get dateEnd
  560.      *
  561.      * @return \DateTime
  562.      */
  563.     public function getDateEnd()
  564.     {
  565.         return $this->dateEnd;
  566.     }
  567.     /**
  568.      * Set pax
  569.      *
  570.      * @param integer $pax
  571.      *
  572.      * @return Reservation
  573.      */
  574.     public function setPax($pax)
  575.     {
  576.         $this->pax $pax;
  577.         return $this;
  578.     }
  579.     /**
  580.      * Get pax
  581.      *
  582.      * @return integer
  583.      */
  584.     public function getPax()
  585.     {
  586.         return $this->pax;
  587.     }
  588.     /**
  589.      * Set deposit
  590.      *
  591.      * @param integer $deposit
  592.      *
  593.      * @return Reservation
  594.      */
  595.     public function setDeposit($deposit)
  596.     {
  597.         $this->deposit $deposit;
  598.         return $this;
  599.     }
  600.     /**
  601.      * Get deposit
  602.      *
  603.      * @return integer
  604.      */
  605.     public function getDeposit()
  606.     {
  607.         return $this->deposit;
  608.     }
  609.     /**
  610.      * Set accessKey
  611.      *
  612.      * @param string $accessKey
  613.      *
  614.      * @return Reservation
  615.      */
  616.     public function setAccessKey($accessKey)
  617.     {
  618.         $this->accessKey $accessKey;
  619.         return $this;
  620.     }
  621.     /**
  622.      * Get accessKey
  623.      *
  624.      * @return string
  625.      */
  626.     public function getAccessKey()
  627.     {
  628.         return $this->accessKey;
  629.     }
  630.     /**
  631.      * Set description
  632.      *
  633.      * @param string $description
  634.      *
  635.      * @return Reservation
  636.      */
  637.     public function setDescription($description)
  638.     {
  639.         $this->description $description;
  640.         return $this;
  641.     }
  642.     /**
  643.      * Get description
  644.      *
  645.      * @return string
  646.      */
  647.     public function getDescription()
  648.     {
  649.         return $this->description;
  650.     }
  651.     /**
  652.      * Set clientContact
  653.      *
  654.      * @param string $clientContact
  655.      *
  656.      * @return Reservation
  657.      */
  658.     public function setClientContact($clientContact)
  659.     {
  660.         $this->clientContact $clientContact;
  661.         return $this;
  662.     }
  663.     /**
  664.      * Get clientContact
  665.      *
  666.      * @return string
  667.      */
  668.     public function getClientContact()
  669.     {
  670.         return $this->clientContact;
  671.     }
  672.     /**
  673.      * Set contactUnregistered
  674.      *
  675.      * @param string $contactUnregistered
  676.      *
  677.      * @return Reservation
  678.      */
  679.     public function setContactUnregistered($contactUnregistered)
  680.     {
  681.         $this->contactUnregistered $contactUnregistered;
  682.         return $this;
  683.     }
  684.     /**
  685.      * Get contactUnregistered
  686.      *
  687.      * @return string
  688.      */
  689.     public function getContactUnregistered()
  690.     {
  691.         return $this->contactUnregistered;
  692.     }
  693.     /**
  694.      * Set days
  695.      *
  696.      * @param string $days
  697.      *
  698.      * @return Reservation
  699.      */
  700.     public function setDays(?\DateTimeInterface $days): self
  701.     {
  702.         $this->days $days;
  703.         
  704.         return $this;
  705.     }
  706.     /**
  707.      * Get days
  708.      *
  709.      * @return string
  710.      */
  711.     public function getDays(): ?\DateTimeInterface
  712.     {
  713.         return $this->days;
  714.     }
  715.     /**
  716.      * Set contract
  717.      *
  718.      * @param string $contract
  719.      *
  720.      * @return Reservation
  721.      */
  722.     public function setContract($contract)
  723.     {
  724.         $this->contract $contract;
  725.         return $this;
  726.     }
  727.     /**
  728.      * Get contract
  729.      *
  730.      * @return string
  731.      */
  732.     public function getContract()
  733.     {
  734.         return $this->contract;
  735.     }
  736.     /**
  737.      * Set nameContactUnregistered
  738.      *
  739.      * @param string $nameContactUnregistered
  740.      *
  741.      * @return Reservation
  742.      */
  743.     public function setNameContactUnregistered($nameContactUnregistered)
  744.     {
  745.         $this->nameContactUnregistered $nameContactUnregistered;
  746.         return $this;
  747.     }
  748.     /**
  749.      * Get nameContactUnregistered
  750.      *
  751.      * @return string
  752.      */
  753.     public function getNameContactUnregistered()
  754.     {
  755.         return $this->nameContactUnregistered;
  756.     }
  757.     /**
  758.      * Set phoneContactUnregistered
  759.      *
  760.      * @param string $phoneContactUnregistered
  761.      *
  762.      * @return Reservation
  763.      */
  764.     public function setPhoneContactUnregistered($phoneContactUnregistered)
  765.     {
  766.         $this->phoneContactUnregistered $phoneContactUnregistered;
  767.         return $this;
  768.     }
  769.     /**
  770.      * Get phoneContactUnregistered
  771.      *
  772.      * @return string
  773.      */
  774.     public function getPhoneContactUnregistered()
  775.     {
  776.         return $this->phoneContactUnregistered;
  777.     }
  778.     public function getHtFile(): ?HtFile
  779.     {
  780.         return $this->htFile;
  781.     }
  782.     public function setHtFile(?HtFile $htFile): self
  783.     {
  784.         // unset the owning side of the relation if necessary
  785.         if ($htFile === null && $this->htFile !== null) {
  786.             $this->htFile->setReservation(null);
  787.         }
  788.         // set the owning side of the relation if necessary
  789.         if ($htFile !== null && $htFile->getReservation() !== $this) {
  790.             $htFile->setReservation($this);
  791.         }
  792.         $this->htFile $htFile;
  793.         return $this;
  794.     }
  795.     /**
  796.      * Set token
  797.      *
  798.      * @param string $token
  799.      *
  800.      * @return Reservation
  801.      */
  802.     public function setToken($token)
  803.     {
  804.         $this->token $token;
  805.         return $this;
  806.     }
  807.     /**
  808.      * Get token
  809.      *
  810.      * @return string
  811.      */
  812.     public function getToken()
  813.     {
  814.         return $this->token;
  815.     }
  816.     /**
  817.      * @return Collection<int, GpReminder>
  818.      */
  819.     public function getGpReminders(): Collection
  820.     {
  821.         return $this->gpReminders;
  822.     }
  823.     public function addGpReminder(GpReminder $gpReminder): self
  824.     {
  825.         if (!$this->gpReminders->contains($gpReminder)) {
  826.             $this->gpReminders[] = $gpReminder;
  827.             $gpReminder->setReservation($this);
  828.         }
  829.         return $this;
  830.     }
  831.     public function removeGpReminder(GpReminder $gpReminder): self
  832.     {
  833.         if ($this->gpReminders->removeElement($gpReminder)) {
  834.             // set the owning side to null (unless already changed)
  835.             if ($gpReminder->getReservation() === $this) {
  836.                 $gpReminder->setReservation(null);
  837.             }
  838.         }
  839.         return $this;
  840.     }
  841.     /**
  842.      * Set comAvGp
  843.      *
  844.      * @param float $comAvGp
  845.      *
  846.      * @return Reservation
  847.      */
  848.     public function setComAvGp($comAvGp)
  849.     {
  850.         $this->comAvGp $comAvGp;
  851.         return $this;
  852.     }
  853.     /**
  854.      * Get comAvGp
  855.      *
  856.      * @return float
  857.      */
  858.     public function getComAvGp()
  859.     {
  860.         return $this->comAvGp;
  861.     }
  862.     /**
  863.      * Set comHtGp
  864.      *
  865.      * @param float $comHtGp
  866.      *
  867.      * @return Reservation
  868.      */
  869.     public function setComHtGp($comHtGp)
  870.     {
  871.         $this->comHtGp $comHtGp;
  872.         return $this;
  873.     }
  874.     /**
  875.      * Get comHtGp
  876.      *
  877.      * @return float
  878.      */
  879.     public function getComHtGp()
  880.     {
  881.         return $this->comHtGp;
  882.     }
  883. }