src/Entity/Product.php line 9

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ProductRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. #[ORM\Entity(repositoryClassProductRepository::class)]
  6. class Product
  7. {
  8.     #[ORM\Id]
  9.     #[ORM\GeneratedValue]
  10.     #[ORM\Column(type'integer')]
  11.     private $id;
  12.     #[ORM\Column(type'string'length255)]
  13.     private $name;
  14.     #[ORM\Column(type'string'length255)]
  15.     private $slug;
  16.     #[ORM\Column(type'string'length255)]
  17.     private $image;
  18.     #[ORM\Column(type'string'length255)]
  19.     private $subtitle;
  20.     #[ORM\Column(type'text')]
  21.     private $description;
  22.     #[ORM\Column(type'float')]
  23.     private $price;
  24.     #[ORM\ManyToOne(targetEntityCategory::class, inversedBy'products')]
  25.     #[ORM\JoinColumn(nullablefalse)]
  26.     private $category;
  27.     #[ORM\Column(type'boolean')]
  28.     private $isInHome;
  29.     public function getId(): ?int
  30.     {
  31.         return $this->id;
  32.     }
  33.     public function getName(): ?string
  34.     {
  35.         return $this->name;
  36.     }
  37.     public function setName(string $name): self
  38.     {
  39.         $this->name $name;
  40.         return $this;
  41.     }
  42.     public function getSlug(): ?string
  43.     {
  44.         return $this->slug;
  45.     }
  46.     public function setSlug(string $slug): self
  47.     {
  48.         $this->slug $slug;
  49.         return $this;
  50.     }
  51.     public function getImage(): ?string
  52.     {
  53.         return $this->image;
  54.     }
  55.     public function setImage(string $image): self
  56.     {
  57.         $this->image $image;
  58.         return $this;
  59.     }
  60.     public function getSubtitle(): ?string
  61.     {
  62.         return $this->subtitle;
  63.     }
  64.     public function setSubtitle(string $subtitle): self
  65.     {
  66.         $this->subtitle $subtitle;
  67.         return $this;
  68.     }
  69.     public function getDescription(): ?string
  70.     {
  71.         return $this->description;
  72.     }
  73.     public function setDescription(string $description): self
  74.     {
  75.         $this->description $description;
  76.         return $this;
  77.     }
  78.     public function getPrice(): ?float
  79.     {
  80.         return $this->price;
  81.     }
  82.     public function setPrice(float $price): self
  83.     {
  84.         $this->price $price;
  85.         return $this;
  86.     }
  87.     public function getCategory(): ?Category
  88.     {
  89.         return $this->category;
  90.     }
  91.     public function setCategory(?Category $category): self
  92.     {
  93.         $this->category $category;
  94.         return $this;
  95.     }
  96.     public function getIsInHome(): ?bool
  97.     {
  98.         return $this->isInHome;
  99.     }
  100.     public function setIsInHome(bool $isInHome): self
  101.     {
  102.         $this->isInHome $isInHome;
  103.         return $this;
  104.     }
  105. }