src/Entity/Product.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ProductRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use App\Entity\Wishlist;
  8. use App\Entity\ProductWishlist;
  9. /**
  10.  * @ORM\Entity(repositoryClass=ProductRepository::class)
  11.  */
  12. class Product
  13. {
  14.     /**
  15.      * @ORM\Id
  16.      * @ORM\GeneratedValue
  17.      * @ORM\Column(type="integer")
  18.      */
  19.     private $id;
  20.     /**
  21.      * @ORM\OneToMany(targetEntity=ProductWishlist::class, mappedBy="product")
  22.      */
  23.     private $productWishlists;
  24.     /**
  25.      * @ORM\Column(type="string", length=255)
  26.      */
  27.     private $name;
  28.     
  29.     /**
  30.      * @ORM\Column(type="string", length=255)
  31.      */
  32.     private $slug;
  33.     /**
  34.      * @ORM\Column(type="string", length=255)
  35.      */
  36.     private $illustration;
  37.     /**
  38.      * @ORM\Column(type="string", length=255)
  39.      */
  40.     private $subtitle;
  41.     /**
  42.      * @ORM\Column(type="text")
  43.      */
  44.     private $description;
  45.     /**
  46.      * @ORM\Column(type="float")
  47.      */
  48.     private $price;
  49.     /**
  50.      * @ORM\ManyToOne(targetEntity=Category::class)
  51.      * @ORM\JoinColumn(name="category_id", referencedColumnName="id")
  52.      */
  53.     private $category;
  54.     public function __construct()
  55.     {
  56.         $this->productWishlists = new ArrayCollection();
  57.     }
  58.     public function getId(): ?int
  59.     {
  60.         return $this->id;
  61.     }
  62.     public function getName(): ?string
  63.     {
  64.         return $this->name;
  65.     }
  66.     public function setName(string $name): self
  67.     {
  68.         $this->name $name;
  69.         return $this;
  70.     }
  71.     public function getSlug(): ?string
  72.     {
  73.         return $this->slug;
  74.     }
  75.     public function setSlug(string $slug): self
  76.     {
  77.         $this->slug $slug;
  78.         return $this;
  79.     }
  80.     public function getIllustration(): ?string
  81.     {
  82.         return $this->illustration;
  83.     }
  84.     public function setIllustration(string $illustration): self
  85.     {
  86.         $this->illustration $illustration;
  87.         return $this;
  88.     }
  89.     public function getSubtitle(): ?string
  90.     {
  91.         return $this->subtitle;
  92.     }
  93.     public function setSubtitle(string $subtitle): self
  94.     {
  95.         $this->subtitle $subtitle;
  96.         return $this;
  97.     }
  98.     public function getDescription(): ?string
  99.     {
  100.         return $this->description;
  101.     }
  102.     public function setDescription(string $description): self
  103.     {
  104.         $this->description $description;
  105.         return $this;
  106.     }
  107.     public function getPrice(): ?float
  108.     {
  109.         return $this->price;
  110.     }
  111.     public function setPrice(float $price): self
  112.     {
  113.         $this->price $price;
  114.         return $this;
  115.     }
  116.     public function getCategory(): ?Category
  117.     {
  118.         return $this->category;
  119.     }
  120.     public function setCategory(?Category $category): self
  121.     {
  122.         $this->category $category;
  123.         return $this;
  124.     }
  125.     /**
  126.      * @return Collection|ProductWishlist[]
  127.      */
  128.     public function getProductWishlists(): Collection
  129.     {
  130.         return $this->productWishlists;
  131.     }
  132. }