src/Entity/Product.php line 13

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ProductRepository;
  4. use DateTime;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\DBAL\Types\Types;
  8. use Doctrine\ORM\Mapping as ORM;
  9. #[ORM\Entity(repositoryClassProductRepository::class)]
  10. class Product
  11. {
  12.     #[ORM\Id]
  13.     #[ORM\GeneratedValue]
  14.     #[ORM\Column(type'integer')]
  15.     private $id;
  16.     #[ORM\Column(type'string'length255nullabletrue)]
  17.     private $name;
  18.     #[ORM\Column(type'string'length255nullabletrue)]
  19.     private $titleTag;
  20.     #[ORM\Column(type'text'nullabletrue)]
  21.     private $metaDescription;
  22.     #[ORM\Column(type'string'length255nullabletrue)]
  23.     private $slug;
  24.     #[ORM\Column(type'text'nullabletrue)]
  25.     private $description;
  26.     #[ORM\Column(type'float'nullabletrue)]
  27.     private $price;
  28.     #[ORM\Column(type'datetime'nullabletrue)]
  29.     private $created;
  30.     #[ORM\Column(type'boolean'nullabletrue)]
  31.     private $isActive;
  32.     #[ORM\Column(type'boolean'nullabletrue)]
  33.     private $extractedHome;
  34.     #[ORM\ManyToOne(targetEntityGallery::class, inversedBy'products')]
  35.     private $gallery;
  36.     #[ORM\ManyToOne(targetEntityCategory::class, inversedBy'products')]
  37.     private $category;
  38.     #[ORM\Column(type'string'length255nullabletrue)]
  39.     private $image;
  40.     #[ORM\OneToMany(mappedBy'product'targetEntityContact::class)]
  41.     private $contacts;
  42.     #[ORM\Column(length255nullabletrue)]
  43.     private ?string $descriptionLink null;
  44.     #[ORM\Column(length255nullabletrue)]
  45.     private ?string $pdf null;
  46.     #[ORM\Column(nullabletrue)]
  47.     private ?bool $mostSold null;
  48.     #[ORM\Column(nullabletrue)]
  49.     private ?bool $new null;
  50.     #[ORM\OneToMany(mappedBy'product'targetEntityProductTranslation::class)]
  51.     private Collection $productTranslations;
  52.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  53.     private ?string $itemText null;
  54.     #[ORM\Column(length20nullabletrue)]
  55.     private ?string $type null;
  56.     #[ORM\Column(length255nullabletrue)]
  57.     private ?string $alias null;
  58.     #[ORM\Column(typeTypes::SMALLINTnullabletrue)]
  59.     private ?int $sequence null;
  60.     #[ORM\Column(nullabletrue)]
  61.     private ?float $oldPrice null;
  62.     #[ORM\Column(nullabletrue)]
  63.     private ?bool $showOnlyUser null;
  64.     #[ORM\Column(nullabletrue)]
  65.     private ?bool $extract null;
  66.     #[ORM\OneToMany(mappedBy'product'targetEntityOrders::class)]
  67.     private Collection $orders;
  68.     #[ORM\Column(length255nullabletrue)]
  69.     private ?string $subscriptionType null;
  70.     #[ORM\Column(nullabletrue)]
  71.     private ?bool $yearlyExtraMonth null;
  72.     #[ORM\Column(length255nullabletrue)]
  73.     private ?string $channelCount null;
  74.     public function __construct(){
  75.         $this->created = new DateTime();
  76.         $this->contacts = new ArrayCollection();
  77.         $this->productTranslations = new ArrayCollection();
  78.         $this->orders = new ArrayCollection();
  79.     }
  80.     public function __toString()
  81.     {
  82.         return 'Product ' $this->getId();
  83.     }
  84.     public function getId(): ?int
  85.     {
  86.         return $this->id;
  87.     }
  88.     public function getName(): ?string
  89.     {
  90.         return $this->name;
  91.     }
  92.     public function setName(?string $name): self
  93.     {
  94.         $this->name $name;
  95.         return $this;
  96.     }
  97.     public function getTitleTag(): ?string
  98.     {
  99.         return $this->titleTag;
  100.     }
  101.     public function setTitleTag(?string $titleTag): self
  102.     {
  103.         $this->titleTag $titleTag;
  104.         return $this;
  105.     }
  106.     public function getMetaDescription(): ?string
  107.     {
  108.         return $this->metaDescription;
  109.     }
  110.     public function setMetaDescription(?string $metaDescription): self
  111.     {
  112.         $this->metaDescription $metaDescription;
  113.         return $this;
  114.     }
  115.     public function getSlug(): ?string
  116.     {
  117.         return $this->slug;
  118.     }
  119.     public function setSlug(?string $slug): self
  120.     {
  121.         $this->slug $slug;
  122.         return $this;
  123.     }
  124.     public function getDescription(): ?string
  125.     {
  126.         return $this->description;
  127.     }
  128.     public function setDescription(?string $description): self
  129.     {
  130.         $this->description $description;
  131.         return $this;
  132.     }
  133.     public function getPrice(): ?float
  134.     {
  135.         return $this->price;
  136.     }
  137.     public function setPrice(?float $price): self
  138.     {
  139.         $this->price $price;
  140.         return $this;
  141.     }
  142.     public function getCreated(): ?\DateTimeInterface
  143.     {
  144.         return $this->created;
  145.     }
  146.     public function setCreated(?\DateTimeInterface $created): self
  147.     {
  148.         $this->created $created;
  149.         return $this;
  150.     }
  151.     public function isIsActive(): ?bool
  152.     {
  153.         return $this->isActive;
  154.     }
  155.     public function setIsActive(?bool $isActive): self
  156.     {
  157.         $this->isActive $isActive;
  158.         return $this;
  159.     }
  160.     public function isExtractedHome(): ?bool
  161.     {
  162.         return $this->extractedHome;
  163.     }
  164.     public function setExtractedHome(?bool $extractedHome): self
  165.     {
  166.         $this->extractedHome $extractedHome;
  167.         return $this;
  168.     }
  169.     public function getGallery(): ?Gallery
  170.     {
  171.         return $this->gallery;
  172.     }
  173.     public function setGallery(?Gallery $gallery): self
  174.     {
  175.         $this->gallery $gallery;
  176.         return $this;
  177.     }
  178.     public function getCategory(): ?Category
  179.     {
  180.         return $this->category;
  181.     }
  182.     public function setCategory(?Category $category): self
  183.     {
  184.         $this->category $category;
  185.         return $this;
  186.     }
  187.     public function getImage(): ?string
  188.     {
  189.         return $this->image;
  190.     }
  191.     public function setImage(?string $image): self
  192.     {
  193.         $this->image $image;
  194.         return $this;
  195.     }
  196.     /**
  197.      * @return Collection<int, Contact>
  198.      */
  199.     public function getContacts(): Collection
  200.     {
  201.         return $this->contacts;
  202.     }
  203.     public function addContact(Contact $contact): self
  204.     {
  205.         if (!$this->contacts->contains($contact)) {
  206.             $this->contacts[] = $contact;
  207.             $contact->setProduct($this);
  208.         }
  209.         return $this;
  210.     }
  211.     public function removeContact(Contact $contact): self
  212.     {
  213.         if ($this->contacts->removeElement($contact)) {
  214.             // set the owning side to null (unless already changed)
  215.             if ($contact->getProduct() === $this) {
  216.                 $contact->setProduct(null);
  217.             }
  218.         }
  219.         return $this;
  220.     }
  221.     public function getDescriptionLink(): ?string
  222.     {
  223.         return $this->descriptionLink;
  224.     }
  225.     public function setDescriptionLink(?string $descriptionLink): self
  226.     {
  227.         $this->descriptionLink $descriptionLink;
  228.         return $this;
  229.     }
  230.     public function getPdf(): ?string
  231.     {
  232.         return $this->pdf;
  233.     }
  234.     public function setPdf(?string $pdf): self
  235.     {
  236.         $this->pdf $pdf;
  237.         return $this;
  238.     }
  239.     public function isMostSold(): ?bool
  240.     {
  241.         return $this->mostSold;
  242.     }
  243.     public function setMostSold(?bool $mostSold): self
  244.     {
  245.         $this->mostSold $mostSold;
  246.         return $this;
  247.     }
  248.     public function isNew(): ?bool
  249.     {
  250.         return $this->new;
  251.     }
  252.     public function setNew(?bool $new): self
  253.     {
  254.         $this->new $new;
  255.         return $this;
  256.     }
  257.     /**
  258.      * @return Collection<int, ProductTranslation>
  259.      */
  260.     public function getProductTranslations(): Collection
  261.     {
  262.         return $this->productTranslations;
  263.     }
  264.     public function addProductTranslation(ProductTranslation $productTranslation): self
  265.     {
  266.         if (!$this->productTranslations->contains($productTranslation)) {
  267.             $this->productTranslations->add($productTranslation);
  268.             $productTranslation->setProduct($this);
  269.         }
  270.         return $this;
  271.     }
  272.     public function removeProductTranslation(ProductTranslation $productTranslation): self
  273.     {
  274.         if ($this->productTranslations->removeElement($productTranslation)) {
  275.             // set the owning side to null (unless already changed)
  276.             if ($productTranslation->getProduct() === $this) {
  277.                 $productTranslation->setProduct(null);
  278.             }
  279.         }
  280.         return $this;
  281.     }
  282.     public function getItemText(): ?string
  283.     {
  284.         return $this->itemText;
  285.     }
  286.     public function setItemText(?string $itemText): self
  287.     {
  288.         $this->itemText $itemText;
  289.         return $this;
  290.     }
  291.     public function getType(): ?string
  292.     {
  293.         return $this->type;
  294.     }
  295.     public function setType(?string $type): self
  296.     {
  297.         $this->type $type;
  298.         return $this;
  299.     }
  300.     public function getAlias(): ?string
  301.     {
  302.         return $this->alias;
  303.     }
  304.     public function setAlias(?string $alias): self
  305.     {
  306.         $this->alias $alias;
  307.         return $this;
  308.     }
  309.     public function getSequence(): ?int
  310.     {
  311.         return $this->sequence;
  312.     }
  313.     public function setSequence(?int $sequence): self
  314.     {
  315.         $this->sequence $sequence;
  316.         return $this;
  317.     }
  318.     public function getOldPrice(): ?float
  319.     {
  320.         return $this->oldPrice;
  321.     }
  322.     public function setOldPrice(?float $oldPrice): self
  323.     {
  324.         $this->oldPrice $oldPrice;
  325.         return $this;
  326.     }
  327.     public function isShowOnlyUser(): ?bool
  328.     {
  329.         return $this->showOnlyUser;
  330.     }
  331.     public function setShowOnlyUser(?bool $showOnlyUser): self
  332.     {
  333.         $this->showOnlyUser $showOnlyUser;
  334.         return $this;
  335.     }
  336.     public function isExtract(): ?bool
  337.     {
  338.         return $this->extract;
  339.     }
  340.     public function setExtract(?bool $extract): self
  341.     {
  342.         $this->extract $extract;
  343.         return $this;
  344.     }
  345.     /**
  346.      * @return Collection<int, Orders>
  347.      */
  348.     public function getOrders(): Collection
  349.     {
  350.         return $this->orders;
  351.     }
  352.     public function addOrder(Orders $order): self
  353.     {
  354.         if (!$this->orders->contains($order)) {
  355.             $this->orders->add($order);
  356.             $order->setProduct($this);
  357.         }
  358.         return $this;
  359.     }
  360.     public function removeOrder(Orders $order): self
  361.     {
  362.         if ($this->orders->removeElement($order)) {
  363.             // set the owning side to null (unless already changed)
  364.             if ($order->getProduct() === $this) {
  365.                 $order->setProduct(null);
  366.             }
  367.         }
  368.         return $this;
  369.     }
  370.     public function getSubscriptionType(): ?string
  371.     {
  372.         return $this->subscriptionType;
  373.     }
  374.     public function setSubscriptionType(?string $subscriptionType): self
  375.     {
  376.         $this->subscriptionType $subscriptionType;
  377.         return $this;
  378.     }
  379.     public function isYearlyExtraMonth(): ?bool
  380.     {
  381.         return $this->yearlyExtraMonth;
  382.     }
  383.     public function setYearlyExtraMonth(?bool $yearlyExtraMonth): self
  384.     {
  385.         $this->yearlyExtraMonth $yearlyExtraMonth;
  386.         return $this;
  387.     }
  388.     public function getChannelCount(): ?string
  389.     {
  390.         return $this->channelCount;
  391.     }
  392.     public function setChannelCount(?string $channelCount): self
  393.     {
  394.         $this->channelCount $channelCount;
  395.         return $this;
  396.     }
  397. }