src/Entity/ProductIcon.php line 10

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Sulu\Bundle\MediaBundle\Entity\MediaInterface;
  5. #[ORM\Entity]
  6. #[ORM\Table(name'app_product_icons')]
  7. class ProductIcon
  8. {
  9.     #[ORM\Id]
  10.     #[ORM\ManyToOne(targetEntityProduct::class, inversedBy'icons')]
  11.     #[ORM\JoinColumn(nullablefalse)]
  12.     private Product $product;
  13.     #[ORM\Id]
  14.     #[ORM\ManyToOne(targetEntityMediaInterface::class)]
  15.     #[ORM\JoinColumn(nullablefalse)]
  16.     private MediaInterface $media;
  17.     #[ORM\Column(type'integer'nullabletrue)]
  18.     private ?int $position null;
  19.     public function getProduct(): Product
  20.     {
  21.         return $this->product;
  22.     }
  23.     public function setProduct(Product $product): static
  24.     {
  25.         $this->product $product;
  26.         return $this;
  27.     }
  28.     public function getMedia(): MediaInterface
  29.     {
  30.         return $this->media;
  31.     }
  32.     public function setMedia(MediaInterface $media): static
  33.     {
  34.         $this->media $media;
  35.         return $this;
  36.     }
  37.     public function getPosition(): ?int
  38.     {
  39.         return $this->position;
  40.     }
  41.     public function setPosition(?int $position): static
  42.     {
  43.         $this->position $position;
  44.         return $this;
  45.     }
  46. }