src/Entity/Gos/Email.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. use Symfony\Component\Validator\Constraints as Assert;
  7. /**
  8.  * @ORM\Table()
  9.  * @ORM\Entity(repositoryClass="App\Repository\EmailRepository")
  10.  * @ORM\HasLifecycleCallbacks
  11.  */
  12. class Email
  13. {
  14.     /**
  15.      * @var integer
  16.      *
  17.      * @ORM\Column(type="integer")
  18.      * @ORM\Id
  19.      * @ORM\GeneratedValue(strategy="AUTO")
  20.      */
  21.     private $id;
  22.     /**
  23.      * @ORM\Column(type="string")
  24.      */
  25.     private $title;
  26.     /**
  27.      * @ORM\Column(type="string")
  28.      */
  29.     private $email;
  30.     /**
  31.      * @ORM\Column(type="string")
  32.      */
  33.     private $fromEmail;
  34.     /**
  35.      * @ORM\Column(type="text")
  36.      */
  37.     private $body;
  38.     /**
  39.      * @ORM\Column(type="datetime", nullable=true)
  40.      */
  41.     private $createdAt;
  42.     /**
  43.      * @ORM\ManyToOne(targetEntity="EmailBody", inversedBy="email")
  44.      * @ORM\JoinColumn()
  45.      */
  46.     private $emailbody;
  47.     /**
  48.      * @ORM\ManyToOne(targetEntity=User::class, inversedBy="emails")
  49.      */
  50.     private $user;
  51.     /** @ORM\PrePersist()() */
  52.     public function prePersist()
  53.     {
  54.         $this->createdAt = new \DateTime();
  55.     }
  56.     public function __toString()
  57.     {
  58.         return (string) $this->title;
  59.     }
  60.     /**
  61.      * Get id
  62.      *
  63.      * @return integer 
  64.      */
  65.     public function getId()
  66.     {
  67.         return $this->id;
  68.     }
  69.     /**
  70.      * Set title
  71.      *
  72.      * @param string $title
  73.      * @return Email
  74.      */
  75.     public function setTitle($title)
  76.     {
  77.         $this->title $title;
  78.         return $this;
  79.     }
  80.     /**
  81.      * Get title
  82.      *
  83.      * @return string 
  84.      */
  85.     public function getTitle()
  86.     {
  87.         return $this->title;
  88.     }
  89.     /**
  90.      * Set email
  91.      *
  92.      * @param string $email
  93.      * @return Email
  94.      */
  95.     public function setEmail($email)
  96.     {
  97.         $this->email $email;
  98.         return $this;
  99.     }
  100.     /**
  101.      * Get email
  102.      *
  103.      * @return string 
  104.      */
  105.     public function getEmail()
  106.     {
  107.         return $this->email;
  108.     }
  109.     /**
  110.      * Set fromEmail
  111.      *
  112.      * @param string $fromEmail
  113.      * @return Email
  114.      */
  115.     public function setFromEmail($fromEmail)
  116.     {
  117.         $this->fromEmail $fromEmail;
  118.         return $this;
  119.     }
  120.     /**
  121.      * Get fromEmail
  122.      *
  123.      * @return string 
  124.      */
  125.     public function getFromEmail()
  126.     {
  127.         return $this->fromEmail;
  128.     }
  129.     /**
  130.      * Set body
  131.      *
  132.      * @param string $body
  133.      * @return Email
  134.      */
  135.     public function setBody($body)
  136.     {
  137.         $this->body $body;
  138.         return $this;
  139.     }
  140.     /**
  141.      * Get body
  142.      *
  143.      * @return string 
  144.      */
  145.     public function getBody()
  146.     {
  147.         return $this->body;
  148.     }
  149.     /**
  150.      * Set createdAt
  151.      *
  152.      * @param \DateTime $createdAt
  153.      * @return Email
  154.      */
  155.     public function setCreatedAt($createdAt)
  156.     {
  157.         $this->createdAt $createdAt;
  158.         return $this;
  159.     }
  160.     /**
  161.      * Get createdAt
  162.      *
  163.      * @return \DateTime 
  164.      */
  165.     public function getCreatedAt()
  166.     {
  167.         return $this->createdAt;
  168.     }
  169.     /**
  170.      * Set emailbody
  171.      *
  172.      * @param \App\Entity\Gos\EmailBody $emailbody
  173.      * @return Email
  174.      */
  175.     public function setEmailbody(\App\Entity\Gos\EmailBody $emailbody null)
  176.     {
  177.         $this->emailbody $emailbody;
  178.         return $this;
  179.     }
  180.     /**
  181.      * Get emailbody
  182.      *
  183.      * @return \App\Entity\Gos\EmailBody
  184.      */
  185.     public function getEmailbody()
  186.     {
  187.         return $this->emailbody;
  188.     }
  189.     public function getUser(): ?User
  190.     {
  191.         return $this->user;
  192.     }
  193.     public function setUser(?User $user): self
  194.     {
  195.         $this->user $user;
  196.         return $this;
  197.     }
  198. }