src/MDS/VenuesBundle/Entity/Reservation.php line 26

Open in your IDE?
  1. <?php
  2. namespace App\MDS\VenuesBundle\Entity;
  3. use App\Entity\GpReminder;
  4. use App\Entity\Client;
  5. use App\Entity\HtFile;
  6. use App\MDS\AvexpressBundle\Entity\AveFiles;
  7. use Doctrine\Common\Collections\ArrayCollection;
  8. use Doctrine\Common\Collections\Collection;
  9. use Doctrine\ORM\Mapping as ORM;
  10. use Symfony\Component\Validator\Constraints as Assert;
  11. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  12. use Symfony\Component\Serializer\Annotation\Ignore;
  13. //use Doctrine\Common\Collections\ArrayCollection;
  14. //use Doctrine\Common\Collections\Collection;
  15. /**
  16.  * Reservation
  17.  *
  18.  * @ORM\Table(name="reservation")
  19.  * @ORM\Entity(repositoryClass="App\MDS\VenuesBundle\Repository\ReservationRepository")
  20.  * @ORM\HasLifecycleCallbacks
  21.  */
  22. class Reservation
  23. {
  24.     /**
  25.      * @var int
  26.      *
  27.      * @ORM\Column(name="id", type="integer")
  28.      * @ORM\Id
  29.      * @ORM\GeneratedValue(strategy="AUTO")
  30.      */
  31.     private $id;
  32.     /**
  33.      * @var string
  34.      *
  35.      * @ORM\Column(name="title", type="string", length=255)
  36.      * @Assert\NotBlank
  37.      */
  38.     private $title;
  39.     /**
  40.      * @ORM\ManyToOne(targetEntity=Client::class)
  41.      * @ORM\JoinColumn(name="client_id", referencedColumnName="id", nullable=true, onDelete="SET NULL")
  42.      */
  43.     private ?Client $client null;
  44.     /**
  45.      * @var string
  46.      *
  47.      * @ORM\Column(name="clientContact", type="string", length=255, nullable=true )
  48.      *
  49.      */
  50.     private $clientContact;
  51.     /**
  52.      * @var string
  53.      *
  54.      * @ORM\Column(name="contactUnregistered", type="string", length=255, nullable=true )
  55.      *
  56.      */
  57.     private $contactUnregistered;
  58.     /**
  59.      * @var string
  60.      *
  61.      * @ORM\Column(name="nameContactUnregistered", type="string", length=255, nullable=true )
  62.      *
  63.      */
  64.     private $nameContactUnregistered;
  65.     /**
  66.      * @var string
  67.      *
  68.      * @ORM\Column(name="phoneContactUnregistered", type="string", length=255, nullable=true )
  69.      *
  70.      */
  71.     private $phoneContactUnregistered;
  72.     /**
  73.      * @var \DateTimeInterface|null
  74.      *
  75.      * @ORM\Column(name="days", type="datetime", nullable=true)
  76.      */
  77.     private $days;
  78.     /**
  79.      * @var \DateTime
  80.      *
  81.      * @ORM\Column(name="createdAt", type="datetime")
  82.      */
  83.     private $createdAt;
  84.     /**
  85.      * @var string
  86.      *
  87.      * @ORM\Column(name="priority", type="string", length=255)
  88.      */
  89.     private $priority;
  90.     /**
  91.      * @var string
  92.      *
  93.      * @ORM\Column(name="createdBy", type="string", length=255)
  94.      */
  95.     private $createdBy;
  96.     /**
  97.      * @var string
  98.      *
  99.      * @ORM\Column(name="supplier", type="string", length=255, nullable=true)
  100.      */
  101.     private $supplier;
  102.     /**
  103.      * @var string
  104.      *
  105.      * @ORM\Column(name="status", type="string", length=255, nullable=true)
  106.      */
  107.     private $status;
  108.     /**
  109.      * @var \DateTime
  110.      *
  111.      * @ORM\Column(name="updatedAt", type="datetime")
  112.      */
  113.     private $updatedAt;
  114.     /**
  115.      * @var string
  116.      *
  117.      * @ORM\Column(name="updatedBy", type="string", length=255)
  118.      */
  119.     private $updatedBy;
  120.     /**
  121.      * @var int
  122.      *
  123.      * @ORM\Column(name="daysBlock", type="integer", nullable=true)
  124.      */
  125.     private $daysBlock;
  126.     /**
  127.      * @var \DateTime
  128.      *
  129.      * @ORM\Column(name="dateStart", type="datetime", nullable=true)
  130.      */
  131.     private $dateStart;
  132.     /**
  133.      * @var \DateTime
  134.      *
  135.      * @ORM\Column(name="dateEnd", type="datetime", nullable=true)
  136.      */
  137.     private $dateEnd;
  138.     /**
  139.      * @var int
  140.      *
  141.      * @ORM\Column(name="pax", type="integer", nullable=true)
  142.      */
  143.     private $pax;
  144.     /**
  145.      * @var string
  146.      *
  147.      * @ORM\Column(name="access_key", type="string", length=255, nullable=true)
  148.      */
  149.     private $accessKey;
  150.     /**
  151.      * @var string
  152.      *
  153.      * @ORM\Column(name="description", type="text", nullable=true)
  154.      */
  155.     private $description;
  156.     /**
  157.      * @var string
  158.      *
  159.      * @ORM\Column(name="contract", type="text", nullable=true)
  160.      */
  161.     private $contract;
  162.     /**
  163.      * @ORM\OneToOne(targetEntity=HtFile::class, mappedBy="reservation", cascade={"persist", "remove"})
  164.      * @Ignore
  165.      */
  166.     private $htFile;
  167.     /**
  168.      * @ORM\OneToOne(targetEntity=AveFiles::class, mappedBy="reservation", cascade={"persist","remove"})
  169.      */
  170.     private ?AveFiles $aveFile null;
  171.     /**
  172.      * @var string
  173.      *
  174.      * @ORM\Column(name="token", type="text", nullable=true)
  175.      */
  176.     private $token;
  177.     /**
  178.      * @ORM\Column(type="boolean", nullable=true)
  179.      */
  180.     private $sucoe;
  181.     public function getId(): ?int
  182.     {
  183.         return $this->id;
  184.     }
  185.     public function getTitle(): ?string
  186.     {
  187.         return $this->title;
  188.     }
  189.     public function setTitle(string $title): self
  190.     {
  191.         $this->title $title;
  192.         return $this;
  193.     }
  194.     public function getClient(): ?Client
  195.     {
  196.         return $this->client;
  197.     }
  198.     public function setClient(?Client $client): self
  199.     {
  200.         $this->client $client;
  201.         return $this;
  202.     }
  203.     public function getClientContact(): ?string
  204.     {
  205.         return $this->clientContact;
  206.     }
  207.     public function setClientContact(?string $clientContact): self
  208.     {
  209.         $this->clientContact $clientContact;
  210.         return $this;
  211.     }
  212.     public function getContactUnregistered(): ?string
  213.     {
  214.         return $this->contactUnregistered;
  215.     }
  216.     public function setContactUnregistered(?string $contactUnregistered): self
  217.     {
  218.         $this->contactUnregistered $contactUnregistered;
  219.         return $this;
  220.     }
  221.     public function getNameContactUnregistered(): ?string
  222.     {
  223.         return $this->nameContactUnregistered;
  224.     }
  225.     public function setNameContactUnregistered(?string $nameContactUnregistered): self
  226.     {
  227.         $this->nameContactUnregistered $nameContactUnregistered;
  228.         return $this;
  229.     }
  230.     public function getPhoneContactUnregistered(): ?string
  231.     {
  232.         return $this->phoneContactUnregistered;
  233.     }
  234.     public function setPhoneContactUnregistered(?string $phoneContactUnregistered): self
  235.     {
  236.         $this->phoneContactUnregistered $phoneContactUnregistered;
  237.         return $this;
  238.     }
  239.     public function getDays(): ?\DateTimeInterface
  240.     {
  241.         return $this->days;
  242.     }
  243.     public function setDays(?\DateTimeInterface $days): self
  244.     {
  245.         $this->days $days;
  246.         return $this;
  247.     }
  248.     public function getCreatedAt(): ?\DateTimeInterface
  249.     {
  250.         return $this->createdAt;
  251.     }
  252.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  253.     {
  254.         $this->createdAt $createdAt;
  255.         return $this;
  256.     }
  257.     public function getPriority(): ?string
  258.     {
  259.         return $this->priority;
  260.     }
  261.     public function setPriority(string $priority): self
  262.     {
  263.         $this->priority $priority;
  264.         return $this;
  265.     }
  266.     public function getCreatedBy(): ?string
  267.     {
  268.         return $this->createdBy;
  269.     }
  270.     public function setCreatedBy(string $createdBy): self
  271.     {
  272.         $this->createdBy $createdBy;
  273.         return $this;
  274.     }
  275.     public function getSupplier(): ?string
  276.     {
  277.         return $this->supplier;
  278.     }
  279.     public function setSupplier(?string $supplier): self
  280.     {
  281.         $this->supplier $supplier;
  282.         return $this;
  283.     }
  284.     public function getStatus(): ?string
  285.     {
  286.         return $this->status;
  287.     }
  288.     public function setStatus(?string $status): self
  289.     {
  290.         $this->status $status;
  291.         return $this;
  292.     }
  293.     public function getUpdatedAt(): ?\DateTimeInterface
  294.     {
  295.         return $this->updatedAt;
  296.     }
  297.     public function setUpdatedAt(\DateTimeInterface $updatedAt): self
  298.     {
  299.         $this->updatedAt $updatedAt;
  300.         return $this;
  301.     }
  302.     public function getUpdatedBy(): ?string
  303.     {
  304.         return $this->updatedBy;
  305.     }
  306.     public function setUpdatedBy(string $updatedBy): self
  307.     {
  308.         $this->updatedBy $updatedBy;
  309.         return $this;
  310.     }
  311.     public function getDaysBlock(): ?int
  312.     {
  313.         return $this->daysBlock;
  314.     }
  315.     public function setDaysBlock(?int $daysBlock): self
  316.     {
  317.         $this->daysBlock $daysBlock;
  318.         return $this;
  319.     }
  320.     public function getDateStart(): ?\DateTimeInterface
  321.     {
  322.         return $this->dateStart;
  323.     }
  324.     public function setDateStart(?\DateTimeInterface $dateStart): self
  325.     {
  326.         $this->dateStart $dateStart;
  327.         return $this;
  328.     }
  329.     public function getDateEnd(): ?\DateTimeInterface
  330.     {
  331.         return $this->dateEnd;
  332.     }
  333.     public function setDateEnd(?\DateTimeInterface $dateEnd): self
  334.     {
  335.         $this->dateEnd $dateEnd;
  336.         return $this;
  337.     }
  338.     public function getPax(): ?int
  339.     {
  340.         return $this->pax;
  341.     }
  342.     public function setPax(?int $pax): self
  343.     {
  344.         $this->pax $pax;
  345.         return $this;
  346.     }
  347.     public function getAccessKey(): ?string
  348.     {
  349.         return $this->accessKey;
  350.     }
  351.     public function setAccessKey(?string $accessKey): self
  352.     {
  353.         $this->accessKey $accessKey;
  354.         return $this;
  355.     }
  356.     public function getDescription(): ?string
  357.     {
  358.         return $this->description;
  359.     }
  360.     public function setDescription(?string $description): self
  361.     {
  362.         $this->description $description;
  363.         return $this;
  364.     }
  365.     public function getContract(): ?string
  366.     {
  367.         return $this->contract;
  368.     }
  369.     public function setContract(?string $contract): self
  370.     {
  371.         $this->contract $contract;
  372.         return $this;
  373.     }
  374.     public function getHtFile(): ?HtFile
  375.     {
  376.         return $this->htFile;
  377.     }
  378.     public function setHtFile(?HtFile $htFile): self
  379.     {
  380.         // unset the owning side of the relation if necessary
  381.         if ($htFile === null && $this->htFile !== null) {
  382.             $this->htFile->setReservation(null);
  383.         }
  384.         // set the owning side of the relation if necessary
  385.         if ($htFile !== null && $htFile->getReservation() !== $this) {
  386.             $htFile->setReservation($this);
  387.         }
  388.         $this->htFile $htFile;
  389.         return $this;
  390.     }
  391.     public function getAveFile(): ?AveFiles
  392.     {
  393.         return $this->aveFile;
  394.     }
  395.     public function setAveFile(?AveFiles $aveFile): self
  396.     {
  397.         $this->aveFile $aveFile;
  398.         // Mantener sincronizada la otra cara
  399.         if ($aveFile && $aveFile->getReservation() !== $this) {
  400.             $aveFile->setReservation($this);
  401.         }
  402.         return $this;
  403.     }
  404.     public function getToken(): ?string
  405.     {
  406.         return $this->token;
  407.     }
  408.     public function setToken(?string $token): self
  409.     {
  410.         $this->token $token;
  411.         return $this;
  412.     }
  413.     public function isSucoe(): ?bool
  414.     {
  415.         return $this->sucoe;
  416.     }
  417.     public function setSucoe(?bool $sucoe): self
  418.     {
  419.         $this->sucoe $sucoe;
  420.         return $this;
  421.     }
  422.     /**
  423.      * @ORM\PrePersist
  424.      */
  425.     public function prePersist()
  426.     {
  427.         if (empty($this->createdAt)) {
  428.             $this->createdAt = new \DateTime();
  429.         }
  430.         if (empty($this->updatedAt)) {
  431.             $this->updatedAt = new \DateTime();
  432.         }
  433.     }
  434.     /**
  435.      * @ORM\PreUpdate
  436.      */
  437.     public function preUpdate()
  438.     {
  439.         $this->updatedAt = new \DateTime();
  440.     }
  441. }