src/Entity/EmailAttachment.php line 17

  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Entity;
  4. use App\Entity\Mapped\Entity;
  5. use App\Repository\EmailAttachmentRepository;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(
  8.     repositoryClassEmailAttachmentRepository::class
  9. )]
  10. #[ORM\Table(
  11.     name'email_attachment'
  12. )]
  13. class EmailAttachment extends Entity
  14. {
  15.     #[ORM\Column(
  16.         name'name',
  17.         type'string'
  18.     )]
  19.     private string $name;
  20.     #[ORM\Column(
  21.         name'file',
  22.         type'string'
  23.     )]
  24.     private string $file;
  25.     #[ORM\Column(
  26.         name'mime_type',
  27.         type'string'
  28.     )]
  29.     private string $mimeType;
  30.     #[ORM\ManyToOne(
  31.         targetEntityEmail::class,
  32.         cascade: ['persist'],
  33.         inversedBy'attachments'
  34.     )]
  35.     #[ORM\JoinColumn(
  36.         name'email'
  37.     )]
  38.     private ?Email $email;
  39.     public function getName(): string
  40.     {
  41.         return $this->name;
  42.     }
  43.     public function setName(string $name): self
  44.     {
  45.         $this->name $name;
  46.         return $this;
  47.     }
  48.     public function getFile(): string
  49.     {
  50.         return $this->file;
  51.     }
  52.     public function setFile(string $file): self
  53.     {
  54.         $this->file $file;
  55.         return $this;
  56.     }
  57.     public function getMimeType(): string
  58.     {
  59.         return $this->mimeType;
  60.     }
  61.     public function setMimeType(string $mimeType): self
  62.     {
  63.         $this->mimeType $mimeType;
  64.         return $this;
  65.     }
  66.     public function getEmail(): ?Email
  67.     {
  68.         return $this->email;
  69.     }
  70.     public function setEmail(?Email $email): self
  71.     {
  72.         $this->email $email;
  73.         return $this;
  74.     }
  75. }