src/Entity/Shop/Product/ProductImage.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Shop\Product;
  3. use App\Entity\BaseEntity;
  4. use App\Repository\Shop\Product\ProductImageRepository;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Symfony\Bridge\Doctrine\IdGenerator\UuidGenerator;
  7. #[ORM\Entity(repositoryClassProductImageRepository::class)]
  8. class ProductImage extends BaseEntity
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\Column(type'guid'uniquetrue)]
  12.     #[ORM\GeneratedValue(strategy'CUSTOM')]
  13.     #[ORM\CustomIdGenerator(class: UuidGenerator::class)]
  14.     private ?string $id;
  15.     #[ORM\Column(length255)]
  16.     private ?string $imageUrl null;
  17.     #[ORM\ManyToOne(inversedBy'productImages')]
  18.     #[ORM\JoinColumn(nullablefalse)]
  19.     private ?Product $product null;
  20.     public function getId(): ?string
  21.     {
  22.         return $this->id;
  23.     }
  24.     public function getImageUrl(): ?string
  25.     {
  26.         return $this->imageUrl;
  27.     }
  28.     public function setImageUrl(string $imageUrl): static
  29.     {
  30.         $this->imageUrl $imageUrl;
  31.         return $this;
  32.     }
  33.     public function getProduct(): ?Product
  34.     {
  35.         return $this->product;
  36.     }
  37.     public function setProduct(?Product $product): static
  38.     {
  39.         $this->product $product;
  40.         return $this;
  41.     }
  42. }