src/Entity/Gos/EmailBody.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(repositoryClass="App\Repository\EmailBodyRepository")
  11.  * @ORM\HasLifecycleCallbacks
  12.  */
  13. class EmailBody
  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="string")
  29.      */
  30.     private $title;
  31.     /**
  32.      * @ORM\Column(type="string")
  33.      */
  34.     private $fromEmail;
  35.     /**
  36.      * @ORM\Column(type="boolean", nullable=true)
  37.      */
  38.     private $emailFromPortal;
  39.     /**
  40.      * @ORM\Column(type="text")
  41.      */
  42.     private $body;
  43.     /**
  44.      * @ORM\OneToMany(targetEntity="Email", mappedBy="emailbody")
  45.      */
  46.     private $email;
  47.     /**
  48.      * @ORM\ManyToOne(targetEntity="EmailTemplate", inversedBy="emailbody")
  49.      * @ORM\JoinColumn()
  50.      */
  51.     private $emailTemplate;
  52.     /**
  53.      * @ORM\ManyToOne(targetEntity="EmailType", inversedBy="emailbody")
  54.      * @ORM\JoinColumn()
  55.      */
  56.     private $emailType;
  57.     /**
  58.      * @ORM\Column(type="text", nullable=true)
  59.      */
  60.     private $testBody;
  61.     /**
  62.      * @ORM\ManyToOne(targetEntity="EmailTemplate", inversedBy="testEmailbody")
  63.      * @ORM\JoinColumn()
  64.      */
  65.     private $testEmailTemplate;
  66.     /**
  67.      * @ORM\Column(type="datetime")
  68.      */
  69.     private $createdAt;
  70.     /**
  71.      * @ORM\Column(type="datetime", nullable=true)
  72.      */
  73.     private $updatedAt;
  74.     /**
  75.      * @ORM\OneToMany(targetEntity=PaymentReminders::class, mappedBy="emailBody")
  76.      */
  77.     private $paymentReminders;
  78.     /** @ORM\PrePersist() */
  79.     public function prePersist()
  80.     {
  81.         $this->createdAt = new \DateTime();
  82.     }
  83.     /** @ORM\PreUpdate() */
  84.     public function preUpdate()
  85.     {
  86.         $this->updatedAt = new \DateTime();
  87.     }
  88.     public function __toString()
  89.     {
  90.         return (string) $this->name;
  91.     }
  92.     /* ****************************** GETTERS & SETTERS ******************************  */
  93.     /**
  94.      * Constructor
  95.      */
  96.     public function __construct()
  97.     {
  98.         $this->email = new ArrayCollection();
  99.         $this->paymentReminders = new ArrayCollection();
  100.     }
  101.     public function getId()
  102.     {
  103.         return $this->id;
  104.     }
  105.     public function setName($name): static
  106.     {
  107.         $this->name $name;
  108.         return $this;
  109.     }
  110.     public function getName(): string
  111.     {
  112.         return $this->name;
  113.     }
  114.     public function setTitle($title)
  115.     {
  116.         $this->title $title;
  117.         return $this;
  118.     }
  119.     public function getTitle()
  120.     {
  121.         return $this->title;
  122.     }
  123.     public function setFromEmail($fromEmail): static
  124.     {
  125.         $this->fromEmail $fromEmail;
  126.         return $this;
  127.     }
  128.     public function getFromEmail()
  129.     {
  130.         return $this->fromEmail;
  131.     }
  132.     public function setEmailFromPortal($emailFromPortal): static
  133.     {
  134.         $this->emailFromPortal $emailFromPortal;
  135.         return $this;
  136.     }
  137.     public function getEmailFromPortal()
  138.     {
  139.         return $this->emailFromPortal;
  140.     }
  141.     public function setBody($body): static
  142.     {
  143.         $this->body $body;
  144.         return $this;
  145.     }
  146.     public function getBody()
  147.     {
  148.         return $this->body;
  149.     }
  150.     public function setCreatedAt($createdAt): static
  151.     {
  152.         $this->createdAt $createdAt;
  153.         return $this;
  154.     }
  155.     public function getCreatedAt()
  156.     {
  157.         return $this->createdAt;
  158.     }
  159.     public function setUpdatedAt($updatedAt): static
  160.     {
  161.         $this->updatedAt $updatedAt;
  162.         return $this;
  163.     }
  164.     /**
  165.      * Get updatedAt
  166.      *
  167.      * @return \DateTime 
  168.      */
  169.     public function getUpdatedAt()
  170.     {
  171.         return $this->updatedAt;
  172.     }
  173.     /**
  174.      * Add email
  175.      *
  176.      * @param Email $email
  177.      * @return EmailBody
  178.      */
  179.     public function addEmail(Email $email)
  180.     {
  181.         $this->email[] = $email;
  182.         return $this;
  183.     }
  184.     /**
  185.      * Remove email
  186.      *
  187.      * @param Email $email
  188.      */
  189.     public function removeEmail(Email $email)
  190.     {
  191.         $this->email->removeElement($email);
  192.     }
  193.     /**
  194.      * Get email
  195.      *
  196.      * @return \Doctrine\Common\Collections\Collection
  197.      */
  198.     public function getEmail()
  199.     {
  200.         return $this->email;
  201.     }
  202.     public function getEmailTemplate()
  203.     {
  204.         return $this->emailTemplate;
  205.     }
  206.     public function setEmailTemplate(EmailTemplate $emailTemplate null): static
  207.     {
  208.         $this->emailTemplate $emailTemplate;
  209.         return $this;
  210.     }
  211.     public function addEmailType(EmailType $emailType): static
  212.     {
  213.         $this->emailType[] = $emailType;
  214.         return $this;
  215.     }
  216.     public function removeEmailType(EmailType $emailType): void
  217.     {
  218.         $this->emailType->removeElement($emailType);
  219.     }
  220.     public function getEmailType()
  221.     {
  222.         return $this->emailType;
  223.     }
  224.     public function setEmailType(EmailType $emailType null): static
  225.     {
  226.         $this->emailType $emailType;
  227.         return $this;
  228.     }
  229.     /**
  230.      * Set testBody
  231.      *
  232.      * @param string $testBody
  233.      * @return EmailBody
  234.      */
  235.     public function setTestBody($testBody)
  236.     {
  237.         $this->testBody $testBody;
  238.         return $this;
  239.     }
  240.     /**
  241.      * Get testBody
  242.      *
  243.      * @return string
  244.      */
  245.     public function getTestBody()
  246.     {
  247.         return $this->testBody;
  248.     }
  249.     /**
  250.      * Get testEmailTemplate
  251.      *
  252.      * @return EmailTemplate|null
  253.      */
  254.     public function getTestEmailTemplate()
  255.     {
  256.         return $this->testEmailTemplate;
  257.     }
  258.     /**
  259.      * Set testEmailTemplate
  260.      *
  261.      * @param EmailTemplate $testEmailTemplate
  262.      * @return EmailBody
  263.      */
  264.     public function setTestEmailTemplate(?EmailTemplate $testEmailTemplate)
  265.     {
  266.         $this->testEmailTemplate $testEmailTemplate;
  267.         return $this;
  268.     }
  269.     /**
  270.      * @return Collection|PaymentReminders[]
  271.      */
  272.     public function getPaymentReminders(): Collection
  273.     {
  274.         return $this->paymentReminders;
  275.     }
  276.     public function addPaymentReminder(PaymentReminders $paymentReminder): self
  277.     {
  278.         if (!$this->paymentReminders->contains($paymentReminder)) {
  279.             $this->paymentReminders[] = $paymentReminder;
  280.             $paymentReminder->setEmailBody($this);
  281.         }
  282.         return $this;
  283.     }
  284.     public function removePaymentReminder(PaymentReminders $paymentReminder): self
  285.     {
  286.         if ($this->paymentReminders->contains($paymentReminder)) {
  287.             $this->paymentReminders->removeElement($paymentReminder);
  288.             // set the owning side to null (unless already changed)
  289.             if ($paymentReminder->getEmailBody() === $this) {
  290.                 $paymentReminder->setEmailBody(null);
  291.             }
  292.         }
  293.         return $this;
  294.     }
  295. }