src/Entity/Product.php line 14

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\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. #[ORM\Entity(repositoryClassProductRepository::class)]
  9. #[ORM\Table(name"product")]
  10. #[ORM\Index(columns: ["name""short_description""long_description""additional_information"], flags: ["fulltext"])]
  11. class Product
  12. {
  13.     #[ORM\Id]
  14.     #[ORM\GeneratedValue]
  15.     #[ORM\Column]
  16.     private ?int $id null;
  17.     #[ORM\Column(length255)]
  18.     private ?string $name null;
  19.     #[ORM\Column(nullabletrue)]
  20.     private ?float $price null;
  21.     #[ORM\Column(length255nullabletrue)]
  22.     private ?string $short_description null;
  23.     #[ORM\Column(length255nullabletrue)]
  24.     private ?string $long_description null;
  25.     #[ORM\Column(length255nullabletrue)]
  26.     private ?string $additional_information null;
  27.     #[ORM\Column(length255nullabletrue)]
  28.     private ?string $main_image_link null;
  29.     #[ORM\Column(length255nullabletrue)]
  30.     private ?string $image_0_link null;
  31.     #[ORM\Column(length255nullabletrue)]
  32.     private ?string $image_1_link null;
  33.     #[ORM\Column(length255nullabletrue)]
  34.     private ?string $image_2_link null;
  35.     #[ORM\ManyToOne(inversedBy'product')]
  36.     private ?Category $category null;
  37.     #[ORM\Column]
  38.     private ?float $weight null;
  39.     #[ORM\Column(length2)]
  40.     private ?string $weight_unit null;
  41.     #[ORM\Column]
  42.     private ?int $stock null;
  43.     #[ORM\Column]
  44.     private ?bool $customizable null;
  45.     public function __construct()
  46.     {
  47.         $this->customizable false;
  48.     }
  49.     public function getId(): ?int
  50.     {
  51.         return $this->id;
  52.     }
  53.     public function getName(): ?string
  54.     {
  55.         return $this->name;
  56.     }
  57.     public function setName(string $name): static
  58.     {
  59.         $this->name $name;
  60.         return $this;
  61.     }
  62.     public function getPrice(): ?float
  63.     {
  64.         return $this->price;
  65.     }
  66.     public function setPrice(?float $price): static
  67.     {
  68.         $this->price $price;
  69.         return $this;
  70.     }
  71.     public function getShortDescription(): ?string
  72.     {
  73.         return $this->short_description;
  74.     }
  75.     public function setShortDescription(?string $short_description): static
  76.     {
  77.         $this->short_description $short_description;
  78.         return $this;
  79.     }
  80.     public function getLongDescription(): ?string
  81.     {
  82.         return $this->long_description;
  83.     }
  84.     public function setLongDescription(?string $long_description): static
  85.     {
  86.         $this->long_description $long_description;
  87.         return $this;
  88.     }
  89.     public function getAdditionalInformation(): ?string
  90.     {
  91.         return $this->additional_information;
  92.     }
  93.     public function setAdditionalInformation(?string $additional_information): static
  94.     {
  95.         $this->additional_information $additional_information;
  96.         return $this;
  97.     }
  98.     public function getMainImageLink(): ?string
  99.     {
  100.         return $this->main_image_link;
  101.     }
  102.     public function setMainImageLink(?string $main_image_link): static
  103.     {
  104.         $this->main_image_link $main_image_link;
  105.         return $this;
  106.     }
  107.     public function getImage0Link(): ?string
  108.     {
  109.         return $this->image_0_link;
  110.     }
  111.     public function setImage0Link(?string $image_0_link): static
  112.     {
  113.         $this->image_0_link $image_0_link;
  114.         return $this;
  115.     }
  116.     public function getImage1Link(): ?string
  117.     {
  118.         return $this->image_1_link;
  119.     }
  120.     public function setImage1Link(?string $image_1_link): static
  121.     {
  122.         $this->image_1_link $image_1_link;
  123.         return $this;
  124.     }
  125.     public function getImage2Link(): ?string
  126.     {
  127.         return $this->image_2_link;
  128.     }
  129.     public function setImage2Link(?string $image_2_link): static
  130.     {
  131.         $this->image_2_link $image_2_link;
  132.         return $this;
  133.     }
  134.     public function getCategory(): ?Category
  135.     {
  136.         return $this->category;
  137.     }
  138.     public function setCategory(?Category $category): static
  139.     {
  140.         $this->category $category;
  141.         return $this;
  142.     }
  143.     public function getWeight(): ?float
  144.     {
  145.         return $this->weight;
  146.     }
  147.     public function setWeight(float $weight): static
  148.     {
  149.         $this->weight $weight;
  150.         return $this;
  151.     }
  152.     public function getWeightUnit(): ?string
  153.     {
  154.         return $this->weight_unit;
  155.     }
  156.     public function setWeightUnit(string $weight_unit): static
  157.     {
  158.         $this->weight_unit $weight_unit;
  159.         return $this;
  160.     }
  161.     public function getStock(): ?int
  162.     {
  163.         return $this->stock;
  164.     }
  165.     public function setStock(int $stock): static
  166.     {
  167.         $this->stock $stock;
  168.         return $this;
  169.     }
  170.     public function isCustomizable(): ?bool
  171.     {
  172.         return $this->customizable;
  173.     }
  174.     public function setCustomizable(bool $customizable): static
  175.     {
  176.         $this->customizable $customizable;
  177.         return $this;
  178.     }
  179. }