src/Entity/Email.php line 18
<?phpdeclare(strict_types=1);namespace App\Entity;use App\Entity\Mapped\Entity;use App\Repository\EmailRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: EmailRepository::class)]#[ORM\Table(name: 'email')]class Email extends Entity{#[ORM\Column(name: 'recipent',type: 'string')]private string $recipient;#[ORM\Column(name: 'title',type: 'string',length: 191)]private string $title;#[ORM\Column(name: 'content',type: 'text')]private string $content;#[ORM\OneToMany(mappedBy: 'email',targetEntity: EmailAttachment::class,cascade: ['persist'],fetch: 'EAGER',orphanRemoval: true)]private object $attachments;public function __construct(){$this->attachments = new ArrayCollection();}public function getRecipient(): string{return $this->recipient;}public function setRecipient(string $recipient): self{$this->recipient = $recipient;return $this;}public function getTitle(): string{return $this->title;}public function setTitle(string $title): self{$this->title = $title;return $this;}public function getContent(): string{return $this->content;}public function setContent(string $content): self{$this->content = $content;return $this;}public function getAttachments(): object{return $this->attachments;}public function addAttachment(EmailAttachment $emailAttachment): void{if ($this->attachments->contains($emailAttachment)) {return;}$emailAttachment->setEmail($this);$this->attachments[] = $emailAttachment;}public function removeAttachment(EmailAttachment $emailAttachment): void{if (!$this->attachments->contains($emailAttachment)) {return;}$emailAttachment->setEmail(null);$this->attachments->removeElement($emailAttachment);}}