src/Entity/Gos/EmailType.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Gos;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Symfony\Component\Validator\Constraints as Assert;
  7. use Gedmo\Mapping\Annotation as Gedmo;
  8. /**
  9.  * @ORM\Table()
  10.  * @ORM\Entity
  11.  * @ORM\HasLifecycleCallbacks
  12.  */
  13. class EmailType
  14. {
  15.     /**
  16.      * @var integer
  17.      *
  18.      * @ORM\Column(type="integer")
  19.      * @ORM\Id
  20.      * @ORM\GeneratedValue(strategy="AUTO")
  21.      */
  22.     private $id;
  23.     /**
  24.      * @ORM\Column(type="string")
  25.      */
  26.     private $name;
  27.     /**
  28.      * @ORM\Column(type="boolean", nullable=true)
  29.      */
  30.     private $isActive;
  31.     /**
  32.      * @ORM\Column(type="datetime")
  33.      */
  34.     private $createdAt;
  35.     /**
  36.      * @ORM\Column(type="datetime", nullable=true)
  37.      */
  38.     private $updatedAt;
  39.     /**
  40.      * @ORM\OneToMany(targetEntity="EmailBody", mappedBy="emailType")
  41.      */
  42.     private $emailbody;
  43.     /** @ORM\PrePersist() */
  44.     public function prePersist()
  45.     {
  46.         $this->createdAt = new \DateTime();
  47.     }
  48.     /** @ORM\PreUpdate() */
  49.     public function preUpdate()
  50.     {
  51.         $this->updatedAt = new \DateTime();
  52.     }
  53.     public function __toString()
  54.     {
  55.         return (string)$this->name;
  56.     }
  57.     /* ****************************** GETTERS & SETTERS ******************************  */
  58.     /**
  59.      * Constructor
  60.      */
  61.     public function __construct()
  62.     {
  63.         $this->emailbody = new \Doctrine\Common\Collections\ArrayCollection();
  64.     }
  65.     /**
  66.      * Get id
  67.      *
  68.      * @return integer 
  69.      */
  70.     public function getId()
  71.     {
  72.         return $this->id;
  73.     }
  74.     /**
  75.      * Set name
  76.      *
  77.      * @param string $name
  78.      * @return EmailType
  79.      */
  80.     public function setName($name)
  81.     {
  82.         $this->name $name;
  83.         return $this;
  84.     }
  85.     /**
  86.      * Get name
  87.      *
  88.      * @return string 
  89.      */
  90.     public function getName()
  91.     {
  92.         return $this->name;
  93.     }
  94.     /**
  95.      * Add emailbody
  96.      *
  97.      * @param \App\Entity\Gos\EmailBody $emailbody
  98.      * @return EmailType
  99.      */
  100.     public function addEmailbody(\App\Entity\Gos\EmailBody $emailbody)
  101.     {
  102.         $this->emailbody[] = $emailbody;
  103.         return $this;
  104.     }
  105.     /**
  106.      * Remove emailbody
  107.      *
  108.      * @param \App\Entity\Gos\EmailBody $emailbody
  109.      */
  110.     public function removeEmailbody(\App\Entity\Gos\EmailBody $emailbody)
  111.     {
  112.         $this->emailbody->removeElement($emailbody);
  113.     }
  114.     /**
  115.      * Get emailbody
  116.      *
  117.      * @return \Doctrine\Common\Collections\Collection 
  118.      */
  119.     public function getEmailbody()
  120.     {
  121.         return $this->emailbody;
  122.     }
  123.     /**
  124.      * Set createdAt
  125.      *
  126.      * @param \DateTime $createdAt
  127.      * @return EmailType
  128.      */
  129.     public function setCreatedAt($createdAt)
  130.     {
  131.         $this->createdAt $createdAt;
  132.         return $this;
  133.     }
  134.     /**
  135.      * Get createdAt
  136.      *
  137.      * @return \DateTime 
  138.      */
  139.     public function getCreatedAt()
  140.     {
  141.         return $this->createdAt;
  142.     }
  143.     /**
  144.      * Set updatedAt
  145.      *
  146.      * @param \DateTime $updatedAt
  147.      * @return EmailType
  148.      */
  149.     public function setUpdatedAt($updatedAt)
  150.     {
  151.         $this->updatedAt $updatedAt;
  152.         return $this;
  153.     }
  154.     /**
  155.      * Get updatedAt
  156.      *
  157.      * @return \DateTime 
  158.      */
  159.     public function getUpdatedAt()
  160.     {
  161.         return $this->updatedAt;
  162.     }
  163.     /**
  164.      * Set isActive
  165.      *
  166.      * @param boolean $isActive
  167.      *
  168.      * @return EmailType
  169.      */
  170.     public function setIsActive($isActive)
  171.     {
  172.         $this->isActive $isActive;
  173.         return $this;
  174.     }
  175.     /**
  176.      * Get isActive
  177.      *
  178.      * @return boolean
  179.      */
  180.     public function getIsActive()
  181.     {
  182.         return $this->isActive;
  183.     }
  184. }