src/Entity/Product.php line 13

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. /**
  8.  * @ORM\Entity(repositoryClass=ProductRepository::class)
  9.  */
  10. class Product
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="string", length=255)
  20.      */
  21.     private $title;
  22.     /**
  23.      * @ORM\Column(type="decimal", precision=10, scale=2)
  24.      */
  25.     private $priceHt;
  26.     /**
  27.      * @ORM\Column(type="text")
  28.      */
  29.     private $desctription;
  30.     /**
  31.      * @ORM\Column(type="string", length=255)
  32.      */
  33.     private $picture;
  34.     /**
  35.      * @ORM\Column(type="string", length=255, nullable=true)
  36.      */
  37.     private $linkspictures;
  38.     /**
  39.      * @ORM\ManyToOne(targetEntity=UserPlatform::class)
  40.      * @ORM\JoinColumn(nullable=false)
  41.      */
  42.     private $userAdd;
  43.     /**
  44.      * @ORM\ManyToOne(targetEntity=CategoriProduct::class)
  45.      * @ORM\JoinColumn(nullable=false)
  46.      */
  47.     private $fkcategorie;
  48.     /**
  49.      * @ORM\ManyToOne(targetEntity=SousCategorie::class)
  50.      */
  51.     private $fksousCategorie;
  52.     /**
  53.      * @ORM\ManyToOne(targetEntity=Devise::class)
  54.      */
  55.     private $fkdevise;
  56.     /**
  57.      * @ORM\ManyToOne(targetEntity=Shop::class)
  58.      */
  59.     private $shop;
  60.     /**
  61.      * @ORM\OneToMany(targetEntity=PriceProduct::class, mappedBy="product")
  62.      */
  63.     private $priceProducts;
  64.     /**
  65.      * @ORM\Column(type="integer")
  66.      */
  67.     private $statdispo;
  68.     /**
  69.      * @ORM\Column(type="integer")
  70.      */
  71.     private $stateval;
  72.     /**
  73.      * @ORM\Column(type="integer")
  74.      */
  75.     private $points;
  76.     /**
  77.      * @ORM\OneToMany(targetEntity=Stock::class, mappedBy="produit")
  78.      */
  79.     private $stocks;
  80.     /**
  81.      * @ORM\Column(type="text", nullable=true)
  82.      */
  83.     private $keyWord;
  84.     /**
  85.      * @ORM\Column(type="boolean", nullable=true)
  86.      */
  87.     private ?bool $productDay false;
  88.     public function isProductDay(): ?bool
  89.     {
  90.         return $this->productDay;
  91.     }
  92.     public function setProductDay(?bool $productDay): self
  93.     {
  94.         $this->productDay $productDay;
  95.         return $this;
  96.     }
  97.     /**
  98.      * @ORM\Column(type="boolean", nullable=true)
  99.      */
  100.     private ?bool $catMode false;
  101.     public function isCatMode(): ?bool
  102.     {
  103.         return $this->catMode;
  104.     }
  105.     public function setCatMode(?bool $catMode): self
  106.     {
  107.         $this->catMode $catMode;
  108.         return $this;
  109.     }
  110.     public function __construct()
  111.     {
  112.         $this->priceProducts = new ArrayCollection();
  113.         $this->stocks = new ArrayCollection();
  114.     }
  115.     public function getId(): ?int
  116.     {
  117.         return $this->id;
  118.     }
  119.     public function getTitle(): ?string
  120.     {
  121.         return $this->title;
  122.     }
  123.     public function setTitle(string $title): self
  124.     {
  125.         $this->title $title;
  126.         return $this;
  127.     }
  128.     public function getPriceHt(): ?string
  129.     {
  130.         return $this->priceHt;
  131.     }
  132.     public function setPriceHt(string $priceHt): self
  133.     {
  134.         $this->priceHt $priceHt;
  135.         return $this;
  136.     }
  137.     public function getDesctription(): ?string
  138.     {
  139.         return $this->desctription;
  140.     }
  141.     public function setDesctription(string $desctription): self
  142.     {
  143.         $this->desctription $desctription;
  144.         return $this;
  145.     }
  146.     public function getPicture(): ?string
  147.     {
  148.         return $this->picture;
  149.     }
  150.     public function setPicture(string $picture): self
  151.     {
  152.         $this->picture $picture;
  153.         return $this;
  154.     }
  155.     public function getLinkspictures(): ?string
  156.     {
  157.         return $this->linkspictures;
  158.     }
  159.     
  160.     public function getLinkspicturesArrays(): ?array
  161.     {
  162.         $typevalue gettype(json_decode($this->linkspictures));
  163.          if(gettype(json_decode($this->linkspictures)) == "array"){
  164.               return json_decode($this->linkspictures);
  165.          } else return null;
  166.     }
  167.     public function setLinkspictures(?string $linkspictures): self
  168.     {
  169.         $this->linkspictures $linkspictures;
  170.         return $this;
  171.     }
  172.     public function getUserAdd(): ?UserPlatform
  173.     {
  174.         return $this->userAdd;
  175.     }
  176.     public function setUserAdd(?UserPlatform $userAdd): self
  177.     {
  178.         $this->userAdd $userAdd;
  179.         return $this;
  180.     }
  181.     public function getFkcategorie(): ?CategoriProduct
  182.     {
  183.         return $this->fkcategorie;
  184.     }
  185.     public function setFkcategorie(?CategoriProduct $fkcategorie): self
  186.     {
  187.         $this->fkcategorie $fkcategorie;
  188.         return $this;
  189.     }
  190.     public function getFksousCategorie(): ?SousCategorie
  191.     {
  192.         return $this->fksousCategorie;
  193.     }
  194.     public function setFksousCategorie(?SousCategorie $fksousCategorie): self
  195.     {
  196.         $this->fksousCategorie $fksousCategorie;
  197.         return $this;
  198.     }
  199.     public function getFkdevise(): ?Devise
  200.     {
  201.         return $this->fkdevise;
  202.     }
  203.     public function setFkdevise(?Devise $fkdevise): self
  204.     {
  205.         $this->fkdevise $fkdevise;
  206.         return $this;
  207.     }
  208.     public function getShop(): ?Shop
  209.     {
  210.         return $this->shop;
  211.     }
  212.     public function setShop(?Shop $shop): self
  213.     {
  214.         $this->shop $shop;
  215.         return $this;
  216.     }
  217.     /**
  218.      * @return Collection<int, PriceProduct>
  219.      */
  220.     public function getPriceProducts(): Collection
  221.     {
  222.         return $this->priceProducts;
  223.     }
  224.     public function addPriceProduct(PriceProduct $priceProduct): self
  225.     {
  226.         if (!$this->priceProducts->contains($priceProduct)) {
  227.             $this->priceProducts[] = $priceProduct;
  228.             $priceProduct->setProduct($this);
  229.         }
  230.         return $this;
  231.     }
  232.     public function removePriceProduct(PriceProduct $priceProduct): self
  233.     {
  234.         if ($this->priceProducts->removeElement($priceProduct)) {
  235.             // set the owning side to null (unless already changed)
  236.             if ($priceProduct->getProduct() === $this) {
  237.                 $priceProduct->setProduct(null);
  238.             }
  239.         }
  240.         return $this;
  241.     }
  242.     public function getStatdispo(): ?int
  243.     {
  244.         return $this->statdispo;
  245.     }
  246.     public function setStatdispo(int $statdispo): self
  247.     {
  248.         $this->statdispo $statdispo;
  249.         return $this;
  250.     }
  251.     public function getStateval(): ?int
  252.     {
  253.         return $this->stateval;
  254.     }
  255.     public function setStateval(int $stateval): self
  256.     {
  257.         $this->stateval $stateval;
  258.         return $this;
  259.     }
  260.     public function getPoints(): ?int
  261.     {
  262.         return $this->points;
  263.     }
  264.     public function setPoints(int $points): self
  265.     {
  266.         $this->points $points;
  267.         return $this;
  268.     }
  269.     /**
  270.      * @return Collection<int, Stock>
  271.      */
  272.     public function getStocks(): Collection
  273.     {
  274.         return $this->stocks;
  275.     }
  276.     public function addStock(Stock $stock): self
  277.     {
  278.         if (!$this->stocks->contains($stock)) {
  279.             $this->stocks[] = $stock;
  280.             $stock->setProduit($this);
  281.         }
  282.         return $this;
  283.     }
  284.     public function removeStock(Stock $stock): self
  285.     {
  286.         if ($this->stocks->removeElement($stock)) {
  287.             // set the owning side to null (unless already changed)
  288.             if ($stock->getProduit() === $this) {
  289.                 $stock->setProduit(null);
  290.             }
  291.         }
  292.         return $this;
  293.     }
  294.     public function getKeyWord(): ?string
  295.     {
  296.         return $this->keyWord;
  297.     }
  298.     public function setKeyWord(?string $keyWord): self
  299.     {
  300.         $this->keyWord $keyWord;
  301.         return $this;
  302.     }
  303. }