<?phpnamespace App\Entity\Gos;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\Validator\Constraints as Assert;/** * @ORM\Table() * @ORM\Entity(repositoryClass="App\Repository\EmailRepository") * @ORM\HasLifecycleCallbacks */class Email{ /** * @var integer * * @ORM\Column(type="integer") * @ORM\Id * @ORM\GeneratedValue(strategy="AUTO") */ private $id; /** * @ORM\Column(type="string") */ private $title; /** * @ORM\Column(type="string") */ private $email; /** * @ORM\Column(type="string") */ private $fromEmail; /** * @ORM\Column(type="text") */ private $body; /** * @ORM\Column(type="datetime", nullable=true) */ private $createdAt; /** * @ORM\ManyToOne(targetEntity="EmailBody", inversedBy="email") * @ORM\JoinColumn() */ private $emailbody; /** * @ORM\ManyToOne(targetEntity=User::class, inversedBy="emails") */ private $user; /** @ORM\PrePersist()() */ public function prePersist() { $this->createdAt = new \DateTime(); } public function __toString() { return (string) $this->title; } /** * Get id * * @return integer */ public function getId() { return $this->id; } /** * Set title * * @param string $title * @return Email */ public function setTitle($title) { $this->title = $title; return $this; } /** * Get title * * @return string */ public function getTitle() { return $this->title; } /** * Set email * * @param string $email * @return Email */ public function setEmail($email) { $this->email = $email; return $this; } /** * Get email * * @return string */ public function getEmail() { return $this->email; } /** * Set fromEmail * * @param string $fromEmail * @return Email */ public function setFromEmail($fromEmail) { $this->fromEmail = $fromEmail; return $this; } /** * Get fromEmail * * @return string */ public function getFromEmail() { return $this->fromEmail; } /** * Set body * * @param string $body * @return Email */ public function setBody($body) { $this->body = $body; return $this; } /** * Get body * * @return string */ public function getBody() { return $this->body; } /** * Set createdAt * * @param \DateTime $createdAt * @return Email */ public function setCreatedAt($createdAt) { $this->createdAt = $createdAt; return $this; } /** * Get createdAt * * @return \DateTime */ public function getCreatedAt() { return $this->createdAt; } /** * Set emailbody * * @param \App\Entity\Gos\EmailBody $emailbody * @return Email */ public function setEmailbody(\App\Entity\Gos\EmailBody $emailbody = null) { $this->emailbody = $emailbody; return $this; } /** * Get emailbody * * @return \App\Entity\Gos\EmailBody */ public function getEmailbody() { return $this->emailbody; } public function getUser(): ?User { return $this->user; } public function setUser(?User $user): self { $this->user = $user; return $this; }}