src/Entity/Photos.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\PhotosRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Component\Serializer\Annotation\Groups;
  6. /**
  7.  * @ORM\Entity(repositoryClass=PhotosRepository::class)
  8.  */
  9. class Photos
  10. {
  11.     /**
  12.      * @ORM\Id()
  13.      * @ORM\GeneratedValue()
  14.      * @ORM\Column(type="integer")
  15.      * @Groups({"post:read"})
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="string", length=255)
  20.      * @Groups({"post:read"})
  21.      */
  22.     private $url;
  23.     /**
  24.      * @ORM\ManyToOne(targetEntity=Product::class, inversedBy="photos")
  25.      */
  26.     private $product;
  27.     public function getId(): ?int
  28.     {
  29.         return $this->id;
  30.     }
  31.     public function getUrl()
  32.     {
  33.         return $this->url;
  34.     }
  35.     public function setUrl($url): self
  36.     {
  37.         $this->url $url;
  38.         return $this;
  39.     }
  40.     public function getProduct(): ?Product
  41.     {
  42.         return $this->product;
  43.     }
  44.     public function setProduct(?Product $product): self
  45.     {
  46.         $this->product $product;
  47.         return $this;
  48.     }
  49. }