src/Entity/EventFormEntity.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. /**
  6.  * @ORM\Entity
  7.  * @ORM\Table(name="event_form_entity")
  8.  * @ORM\HasLifecycleCallbacks()
  9.  */
  10. class EventFormEntity
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue(strategy="AUTO")
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\ManyToOne(targetEntity="App\Entity\MobileAppEvent", inversedBy="eventFormEntities")
  20.      * @ORM\JoinColumn(name="eid", referencedColumnName="eid")
  21.      */
  22.     private $event;
  23.     /**
  24.      * @ORM\Column(type="json")
  25.      */
  26.     private $dataForm;
  27.     /**
  28.      * @ORM\Column(type="json")
  29.      */
  30.     private $terms;
  31.     /**
  32.      * @ORM\Column(type="datetime")
  33.      */
  34.     private $createDate;
  35.     /**
  36.      * @ORM\Column(type="datetime")
  37.      */
  38.     private $updateDate;
  39.     public function getId()
  40.     {
  41.         return $this->id;
  42.     }
  43.     public function getEvent()
  44.     {
  45.         return $this->event;
  46.     }
  47.     public function setEvent($event)
  48.     {
  49.         $this->event $event;
  50.         return $this;
  51.     }
  52.     public function getDataForm()
  53.     {
  54.         return $this->dataForm;
  55.     }
  56.     public function setDataForm($dataForm)
  57.     {
  58.         $this->dataForm $dataForm;
  59.         return $this;
  60.     }
  61.     public function getTerms()
  62.     {
  63.         return $this->terms;
  64.     }
  65.     public function setTerms($terms)
  66.     {
  67.         $this->terms $terms;
  68.         return $this;
  69.     }
  70.     public function getCreateDate()
  71.     {
  72.         return $this->createDate;
  73.     }
  74.     public function setCreateDate($createDate)
  75.     {
  76.         $this->createDate $createDate;
  77.         return $this;
  78.     }
  79.     public function getUpdateDate()
  80.     {
  81.         return $this->updateDate;
  82.     }
  83.     public function setUpdateDate($updateDate)
  84.     {
  85.         $this->updateDate $updateDate;
  86.         return $this;
  87.     }
  88.     /**
  89.      * @ORM\PrePersist
  90.      */
  91.     public function prePersist()
  92.     {
  93.         if (!$this->getCreateDate()) {
  94.             $this->setCreateDate(new \DateTime());
  95.         }
  96.         $this->setUpdateDate(new \DateTime());
  97.     }
  98.     /**
  99.      * @ORM\PreUpdate
  100.      */
  101.     public function preUpdate()
  102.     {
  103.         $this->setUpdateDate(new \DateTime());
  104.     }
  105. }