src/Entity/AdvertisementAttachment.php line 9

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\AdvertisementAttachmentRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. #[ORM\Entity(repositoryClassAdvertisementAttachmentRepository::class)]
  6. class AdvertisementAttachment
  7. {
  8.     #[ORM\Id]
  9.     #[ORM\GeneratedValue]
  10.     #[ORM\Column]
  11.     private ?int $id null;
  12.     #[ORM\ManyToOne(cascade: ["persist"], inversedBy'attachments')]
  13.     #[ORM\JoinColumn(nullablefalse)]
  14.     private ?Advertisement $advertisement null;
  15.     #[ORM\OneToOne(cascade: ['persist''remove'])]
  16.     #[ORM\JoinColumn(nullablefalse)]
  17.     private ?Attachment $attachment null;
  18.     public function getId(): ?int
  19.     {
  20.         return $this->id;
  21.     }
  22.     public function getAdvertisement(): ?Advertisement
  23.     {
  24.         return $this->advertisement;
  25.     }
  26.     public function setAdvertisement(?Advertisement $advertisement): static
  27.     {
  28.         $this->advertisement $advertisement;
  29.         return $this;
  30.     }
  31.     public function getAttachment(): ?Attachment
  32.     {
  33.         return $this->attachment;
  34.     }
  35.     public function setAttachment(Attachment $attachment): static
  36.     {
  37.         $this->attachment $attachment;
  38.         return $this;
  39.     }
  40. }