<?phpnamespace App\Entity;use App\Repository\ProductImageRepository;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: ProductImageRepository::class)]#[ORM\Table(name: "dtb_product_image")]class ProductImage{ #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column] private ?int $id = null; #[ORM\ManyToOne(targetEntity: Product::class, inversedBy: 'productImages')] #[ORM\JoinColumn(name: 'product_id', referencedColumnName: 'id', nullable: true)] private ?Product $Product = null; #[ORM\ManyToOne(targetEntity: Member::class)] #[ORM\JoinColumn(name: "creator_id", referencedColumnName: "id", nullable: true)] private ?Member $Creator = null; #[ORM\Column(length: 255)] private ?string $file_name = null; #[ORM\Column(type: Types::SMALLINT)] private ?int $sort_no = null; #[ORM\Column(type: Types::DATETIME_MUTABLE)] private ?\DateTimeInterface $create_date = null; #[ORM\Column(length: 255)] private ?string $discriminator_type = 'productimage'; public function getId(): ?int { return $this->id; } /** * Set the product. * * @param Product|null $product * @return self */ public function setProduct(?Product $product): self { $this->Product = $product; return $this; } /** * Get the product. * * @return Product|null */ public function getProduct(): ?Product { return $this->Product; } /** * Set the creator. * * @param Member|null $creator * @return self */ public function setCreator(?Member $creator): self { $this->Creator = $creator; return $this; } /** * Get the creator. * * @return Member|null */ public function getCreator(): ?Member { return $this->Creator; } public function getFileName(): ?string { return $this->file_name; } public function setFileName(string $file_name): static { $this->file_name = $file_name; return $this; } public function getSortNo(): ?int { return $this->sort_no; } public function setSortNo(int $sort_no): static { $this->sort_no = $sort_no; return $this; } public function getCreateDate(): ?\DateTimeInterface { return $this->create_date; } public function setCreateDate(\DateTimeInterface $create_date): static { $this->create_date = $create_date; return $this; } public function getDiscriminatorType(): ?string { return $this->discriminator_type; } public function setDiscriminatorType(string $discriminator_type): static { $this->discriminator_type = $discriminator_type; return $this; } /** * 画像ファイルのURLを生成する * * @return string|null */ public function getFilePath(): ?string { return '/uploads/eccube_images/' . $this->file_name; }}