<?php
namespace App\Entity\Shop\Product;
use App\Entity\BaseEntity;
use App\Repository\Shop\Product\ProductImageRepository;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\IdGenerator\UuidGenerator;
#[ORM\Entity(repositoryClass: ProductImageRepository::class)]
class ProductImage extends BaseEntity
{
#[ORM\Id]
#[ORM\Column(type: 'guid', unique: true)]
#[ORM\GeneratedValue(strategy: 'CUSTOM')]
#[ORM\CustomIdGenerator(class: UuidGenerator::class)]
private ?string $id;
#[ORM\Column(length: 255)]
private ?string $imageUrl = null;
#[ORM\ManyToOne(inversedBy: 'productImages')]
#[ORM\JoinColumn(nullable: false)]
private ?Product $product = null;
public function getId(): ?string
{
return $this->id;
}
public function getImageUrl(): ?string
{
return $this->imageUrl;
}
public function setImageUrl(string $imageUrl): static
{
$this->imageUrl = $imageUrl;
return $this;
}
public function getProduct(): ?Product
{
return $this->product;
}
public function setProduct(?Product $product): static
{
$this->product = $product;
return $this;
}
}