src/Entity/Product.php line 12

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. class Product
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id null;
  15.     #[ORM\Column(length255)]
  16.     private ?string $name null;
  17.     #[ORM\Column(length255)]
  18.     private ?string $slug null;
  19.     #[ORM\Column(length255)]
  20.     private ?string $illustration null;
  21.     #[ORM\Column(length255)]
  22.     private ?string $subtitle null;
  23.     #[ORM\Column(typeTypes::TEXT)]
  24.     private ?string $description null;
  25.     #[ORM\Columnnullabletrue)]
  26.     private ?float $price null;
  27.     #[ORM\ManyToMany(targetEntityCategory::class, inversedBy'products')]
  28.     private Collection $category;
  29.     #[ORM\Column]
  30.     private ?bool $isBest null;
  31.     
  32.     #[ORM\Column]
  33.     private ?bool $isDog null;
  34.     #[ORM\Column(length255nullabletrue)]
  35.     private ?string $gallery null;
  36.     #[ORM\Column(length255nullabletrue)]
  37.     private ?string $gallery2 null;
  38.     #[ORM\Column(length255nullabletrue)]
  39.     private ?string $gallery3 null;
  40.     #[ORM\Column(length255nullabletrue)]
  41.     private ?string $gallery4 null;
  42.     #[ORM\Column(length255nullabletrue)]
  43.     private ?string $gallery5 null;
  44.     #[ORM\Column(length255nullabletrue)]
  45.     private ?string $gallery6 null;
  46.     #[ORM\OneToMany(mappedBy'activity'targetEntityComments::class)]
  47.     private Collection $comments;
  48.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  49.     private ?string $place null;
  50.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  51.     private ?string $age null;
  52.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  53.     private ?string $rate null;
  54.     public function __construct()
  55.     {
  56.         $this->category = new ArrayCollection();
  57.         $this->comments = new ArrayCollection();
  58.     }
  59.     public function __toString()
  60.     {
  61.         return $this->getName();
  62.     }
  63.     public function getId(): ?int
  64.     {
  65.         return $this->id;
  66.     }
  67.     public function getName(): ?string
  68.     {
  69.         return $this->name;
  70.     }
  71.     public function setName(string $name): self
  72.     {
  73.         $this->name $name;
  74.         return $this;
  75.     }
  76.     public function getSlug(): ?string
  77.     {
  78.         return $this->slug;
  79.     }
  80.     public function setSlug(string $slug): self
  81.     {
  82.         $this->slug $slug;
  83.         return $this;
  84.     }
  85.     public function getIllustration(): ?string
  86.     {
  87.         return $this->illustration;
  88.     }
  89.     public function setIllustration(string $illustration): self
  90.     {
  91.         $this->illustration $illustration;
  92.         return $this;
  93.     }
  94.     public function getSubtitle(): ?string
  95.     {
  96.         return $this->subtitle;
  97.     }
  98.     public function setSubtitle(string $subtitle): self
  99.     {
  100.         $this->subtitle $subtitle;
  101.         return $this;
  102.     }
  103.     public function getDescription(): ?string
  104.     {
  105.         return $this->description;
  106.     }
  107.     public function setDescription(string $description): self
  108.     {
  109.         $this->description $description;
  110.         return $this;
  111.     }
  112.     public function getPrice(): ?float
  113.     {
  114.         return $this->price;
  115.     }
  116.     public function setPrice(float $price): self
  117.     {
  118.         $this->price $price;
  119.         return $this;
  120.     }
  121.     /**
  122.      * @return Collection<int, Category>
  123.      */
  124.     public function getCategory(): Collection
  125.     {
  126.         return $this->category;
  127.     }
  128.     public function addCategory(Category $category): self
  129.     {
  130.         if (!$this->category->contains($category)) {
  131.             $this->category->add($category);
  132.         }
  133.         return $this;
  134.     }
  135.     public function removeCategory(Category $category): self
  136.     {
  137.         $this->category->removeElement($category);
  138.         return $this;
  139.     }
  140.     public function isIsBest(): ?bool
  141.     {
  142.         return $this->isBest;
  143.     }
  144.     public function setIsBest(bool $isBest): self
  145.     {
  146.         $this->isBest $isBest;
  147.         return $this;
  148.     }
  149.     public function isIsDog(): ?bool
  150.     {
  151.         return $this->isDog;
  152.     }
  153.     public function setIsDog(bool $isDog): self
  154.     {
  155.         $this->isDog $isDog;
  156.         return $this;
  157.     }
  158.     public function getGallery(): ?string
  159.     {
  160.         return $this->gallery;
  161.     }
  162.     public function setGallery(?string $gallery): self
  163.     {
  164.         $this->gallery $gallery;
  165.         return $this;
  166.     }
  167.     public function getGallery2(): ?string
  168.     {
  169.         return $this->gallery2;
  170.     }
  171.     public function setGallery2(?string $gallery2): self
  172.     {
  173.         $this->gallery2 $gallery2;
  174.         return $this;
  175.     }
  176.     public function getGallery3(): ?string
  177.     {
  178.         return $this->gallery3;
  179.     }
  180.     public function setGallery3(?string $gallery3): self
  181.     {
  182.         $this->gallery3 $gallery3;
  183.         return $this;
  184.     }
  185.     public function getGallery4(): ?string
  186.     {
  187.         return $this->gallery4;
  188.     }
  189.     public function setGallery4(?string $gallery4): self
  190.     {
  191.         $this->gallery4 $gallery4;
  192.         return $this;
  193.     }
  194.     public function getGallery5(): ?string
  195.     {
  196.         return $this->gallery5;
  197.     }
  198.     public function setGallery5(?string $gallery5): self
  199.     {
  200.         $this->gallery5 $gallery5;
  201.         return $this;
  202.     }    public function getGallery6(): ?string
  203.     {
  204.         return $this->gallery6;
  205.     }
  206.     public function setGallery6(?string $gallery6): self
  207.     {
  208.         $this->gallery6 $gallery6;
  209.         return $this;
  210.     }
  211.     /**
  212.      * @return Collection<int, Comments>
  213.      */
  214.     public function getComments(): Collection
  215.     {
  216.         return $this->comments;
  217.     }
  218.     public function addComment(Comments $comment): self
  219.     {
  220.         if (!$this->comments->contains($comment)) {
  221.             $this->comments->add($comment);
  222.             $comment->setActivity($this);
  223.         }
  224.         return $this;
  225.     }
  226.     public function removeComment(Comments $comment): self
  227.     {
  228.         if ($this->comments->removeElement($comment)) {
  229.             // set the owning side to null (unless already changed)
  230.             if ($comment->getActivity() === $this) {
  231.                 $comment->setActivity(null);
  232.             }
  233.         }
  234.         return $this;
  235.     }
  236.     public function getPlace(): ?string
  237.     {
  238.         return $this->place;
  239.     }
  240.     public function setPlace(?string $place): self
  241.     {
  242.         $this->place $place;
  243.         return $this;
  244.     }
  245.     public function getAge(): ?string
  246.     {
  247.         return $this->age;
  248.     }
  249.     public function setAge(?string $age): self
  250.     {
  251.         $this->age $age;
  252.         return $this;
  253.     }
  254.     public function getRate(): ?string
  255.     {
  256.         return $this->rate;
  257.     }
  258.     public function setRate(?string $rate): self
  259.     {
  260.         $this->rate $rate;
  261.         return $this;
  262.     }
  263. }