src/Entity/Gos/EmailSettings.php line 15

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. /**
  7.  * MailingType
  8.  * @ORM\Table()
  9.  * @ORM\Entity()
  10.  * @ORM\HasLifecycleCallbacks()
  11.  */
  12. class EmailSettings
  13. {
  14.     /**
  15.      * @var int
  16.      *
  17.      * @ORM\Column(type="integer")
  18.      * @ORM\Id()
  19.      * @ORM\GeneratedValue(strategy="AUTO")
  20.      */
  21.     private $id;
  22.     /**
  23.      * @var bool
  24.      *
  25.      * @ORM\Column(type="boolean", nullable=true)
  26.      */
  27.     private $isActive;
  28.     /**
  29.      * @var string
  30.      *
  31.      * @ORM\Column(type="string", length=255)
  32.      */
  33.     private $name;
  34.     /**
  35.      * @ORM\OneToMany(targetEntity="App\Entity\Gos\PortalSettings", mappedBy="emailSettings")
  36.      */
  37.     private $portalSettings;
  38.     /**
  39.      * @ORM\OneToMany(targetEntity="App\Entity\Gos\EmailTemplate", mappedBy="emailSettings")
  40.      */
  41.     private $emailTemplate;
  42.     /**
  43.      * @ORM\Column(type="datetime")
  44.      */
  45.     private $createdAt;
  46.     /**
  47.      * @ORM\Column(type="datetime", nullable=true)
  48.      */
  49.     private $updatedAt;
  50.     public function __construct()
  51.     {
  52.         $this->portalSettings = new ArrayCollection();
  53.         $this->emailTemplate = new ArrayCollection();
  54.     }
  55.     /** @ORM\PrePersist() */
  56.     public function prePersist()
  57.     {
  58.         $this->createdAt = new \DateTime();
  59.     }
  60.     /** @ORM\PreUpdate() */
  61.     public function preUpdate()
  62.     {
  63.         $this->updatedAt = new \DateTime();
  64.     }
  65.     public function __toString()
  66.     {
  67.         return (string)$this->name;
  68.     }
  69.     /**
  70.      * Get id
  71.      *
  72.      * @return int
  73.      */
  74.     public function getId()
  75.     {
  76.         return $this->id;
  77.     }
  78.     /**
  79.      * Set isActive
  80.      *
  81.      * @param boolean $isActive
  82.      * @return MailingType
  83.      */
  84.     public function setIsActive($isActive)
  85.     {
  86.         $this->isActive $isActive;
  87.         return $this;
  88.     }
  89.     /**
  90.      * Get isActive
  91.      *
  92.      * @return boolean
  93.      */
  94.     public function getIsActive()
  95.     {
  96.         return $this->isActive;
  97.     }
  98.     /**
  99.      * Set name
  100.      *
  101.      * @param string $name
  102.      * @return MailingType
  103.      */
  104.     public function setName($name)
  105.     {
  106.         $this->name $name;
  107.         return $this;
  108.     }
  109.     /**
  110.      * Get name
  111.      *
  112.      * @return string
  113.      */
  114.     public function getName()
  115.     {
  116.         return $this->name;
  117.     }
  118.     /**
  119.      * Set portalSettings
  120.      *
  121.      * @param \App\Entity\Gos\PortalSettings $portalSettings
  122.      * @return EmailSettings
  123.      */
  124.     public function setPortalSettings(\App\Entity\Gos\PortalSettings $portalSettings)
  125.     {
  126.         $this->portalSettings $portalSettings;
  127.         return $this;
  128.     }
  129.     /**
  130.      * Get portalSettings
  131.      *
  132.      * @return \App\Entity\Gos\PortalSettings
  133.      */
  134.     public function getPortalSettings()
  135.     {
  136.         return $this->portalSettings;
  137.     }
  138.     /**
  139.      * Set emailTemplate
  140.      *
  141.      * @param \App\Entity\Gos\EmailTemplate $emailTemplate
  142.      * @return EmailSettings
  143.      */
  144.     public function setEmailTemplate(\App\Entity\Gos\EmailTemplate $emailTemplate)
  145.     {
  146.         $this->emailTemplate $emailTemplate;
  147.         return $this;
  148.     }
  149.     /**
  150.      * Get emailTemplate
  151.      *
  152.      * @return \App\Entity\Gos\EmailTemplate
  153.      */
  154.     public function getEmailTemplate()
  155.     {
  156.         return $this->emailTemplate;
  157.     }
  158.     /**
  159.      * Set createdAt
  160.      *
  161.      * @param \DateTime $createdAt
  162.      * @return MailingType
  163.      */
  164.     public function setCreatedAt($createdAt)
  165.     {
  166.         $this->createdAt $createdAt;
  167.         return $this;
  168.     }
  169.     /**
  170.      * Get createdAt
  171.      *
  172.      * @return \DateTime
  173.      */
  174.     public function getCreatedAt()
  175.     {
  176.         return $this->createdAt;
  177.     }
  178.     /**
  179.      * Set updatedAt
  180.      *
  181.      * @param \DateTime $updatedAt
  182.      * @return MailingType
  183.      */
  184.     public function setUpdatedAt($updatedAt)
  185.     {
  186.         $this->updatedAt $updatedAt;
  187.         return $this;
  188.     }
  189.     /**
  190.      * Get updatedAt
  191.      *
  192.      * @return \DateTime
  193.      */
  194.     public function getUpdatedAt()
  195.     {
  196.         return $this->updatedAt;
  197.     }
  198.     public function addPortalSetting(PortalSettings $portalSetting): self
  199.     {
  200.         if (!$this->portalSettings->contains($portalSetting)) {
  201.             $this->portalSettings[] = $portalSetting;
  202.             $portalSetting->setMailingType($this);
  203.         }
  204.         return $this;
  205.     }
  206.     public function removePortalSetting(PortalSettings $portalSetting): self
  207.     {
  208.         if ($this->portalSettings->contains($portalSetting)) {
  209.             $this->portalSettings->removeElement($portalSetting);
  210.             // set the owning side to null (unless already changed)
  211.             if ($portalSetting->getMailingType() === $this) {
  212.                 $portalSetting->setMailingType(null);
  213.             }
  214.         }
  215.         return $this;
  216.     }
  217.     public function addEmailTemplate(EmailTemplate $emailTemplate): self
  218.     {
  219.         if (!$this->emailTemplate->contains($emailTemplate)) {
  220.             $this->emailTemplate[] = $emailTemplate;
  221.             $emailTemplate->setEmailSettings($this);
  222.         }
  223.         return $this;
  224.     }
  225.     public function removeEmailTemplate(EmailTemplate $emailTemplate): self
  226.     {
  227.         if ($this->emailTemplate->contains($emailTemplate)) {
  228.             $this->emailTemplate->removeElement($emailTemplate);
  229.             // set the owning side to null (unless already changed)
  230.             if ($emailTemplate->getEmailSettings() === $this) {
  231.                 $emailTemplate->setEmailSettings(null);
  232.             }
  233.         }
  234.         return $this;
  235.     }
  236. }