<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use Sulu\Bundle\MediaBundle\Entity\MediaInterface;
#[ORM\Entity]
#[ORM\Table(name: 'app_product_icons')]
class ProductIcon
{
#[ORM\Id]
#[ORM\ManyToOne(targetEntity: Product::class, inversedBy: 'icons')]
#[ORM\JoinColumn(nullable: false)]
private Product $product;
#[ORM\Id]
#[ORM\ManyToOne(targetEntity: MediaInterface::class)]
#[ORM\JoinColumn(nullable: false)]
private MediaInterface $media;
#[ORM\Column(type: 'integer', nullable: true)]
private ?int $position = null;
public function getProduct(): Product
{
return $this->product;
}
public function setProduct(Product $product): static
{
$this->product = $product;
return $this;
}
public function getMedia(): MediaInterface
{
return $this->media;
}
public function setMedia(MediaInterface $media): static
{
$this->media = $media;
return $this;
}
public function getPosition(): ?int
{
return $this->position;
}
public function setPosition(?int $position): static
{
$this->position = $position;
return $this;
}
}