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 $name;
  22.     /**
  23.      * @ORM\Column(type="text", nullable=true)
  24.      */
  25.     private $description;
  26.     /**
  27.      * @ORM\Column(type="string", length=255, nullable=true)
  28.      */
  29.     private $cip7;
  30.     /**
  31.      * @ORM\Column(type="string", length=255, nullable=true)
  32.      */
  33.     private $cip13;
  34.     /**
  35.      * @ORM\Column(type="float", nullable=true)
  36.      */
  37.     private $pricegrossiste;
  38.     /**
  39.      * @ORM\Column(type="float", nullable=true)
  40.      */
  41.     private $pricepharmacie;
  42.     /**
  43.      * @ORM\Column(type="integer", nullable=true)
  44.      */
  45.     private $quantity;
  46.     /**
  47.      * @ORM\Column(type="string", length=255, nullable=true)
  48.      */
  49.     private $collissage;
  50.     /**
  51.      * @ORM\Column(type="integer", nullable=true)
  52.      */
  53.     private $quantitymin;
  54.     /**
  55.      * @ORM\Column(type="string", length=255, nullable=true)
  56.      */
  57.     private $amm;
  58.     /**
  59.      * @ORM\Column(type="string", length=255, nullable=true)
  60.      */
  61.     private $cg;
  62.     /**
  63.      * @ORM\Column(type="string", length=255, nullable=true)
  64.      */
  65.     private $disponibilite;
  66.     /**
  67.      * @ORM\ManyToOne(targetEntity=Category::class, inversedBy="products")
  68.      */
  69.     private $category;
  70.     /**
  71.      * @ORM\ManyToOne(targetEntity=Speciality::class, inversedBy="products")
  72.      */
  73.     private $specialite;
  74.     /**
  75.      * @ORM\OneToMany(targetEntity=PropositionDetails::class, mappedBy="product")
  76.      */
  77.     private $propositionDetails;
  78.     /**
  79.      * @ORM\OneToMany(targetEntity=OrderDetails::class, mappedBy="product_id")
  80.      */
  81.     private $orderDetails;
  82.     /**
  83.      * @ORM\ManyToOne(targetEntity=ColisageType::class, inversedBy="products")
  84.      */
  85.     private $colisageType;
  86.     /**
  87.      * @ORM\OneToMany(targetEntity=Cart::class, mappedBy="produit")
  88.      */
  89.     private $carts;
  90.     /**
  91.      * @ORM\Column(type="string", length=255, nullable=true)
  92.      */
  93.     private $pays;
  94.     /**
  95.      * @ORM\ManyToOne(targetEntity=DeclinaisonForm::class, inversedBy="products")
  96.      */
  97.     private $declinaisonform;
  98.     /**
  99.      * @ORM\Column(type="integer", nullable=true)
  100.      */
  101.     private $previsionarrivage;
  102.     /**
  103.      * @ORM\ManyToOne(targetEntity=Pays::class, inversedBy="products")
  104.      */
  105.     private $payslocalisation;
  106.     /**
  107.      * @ORM\ManyToOne(targetEntity=Laboratoire::class, inversedBy="products")
  108.      */
  109.     private $laboratoire;
  110.     /**
  111.      * @ORM\Column(type="text", nullable=true)
  112.      */
  113.     private $indication;
  114.     /**
  115.      * @ORM\OneToMany(targetEntity=ForecastDetails::class, mappedBy="produit_id")
  116.      */
  117.     private $forecastDetails;
  118.     /**
  119.      * @ORM\OneToMany(targetEntity=Photo::class, mappedBy="produit")
  120.      */
  121.     private $photos;
  122.     /**
  123.      * @ORM\OneToMany(targetEntity=Stockpharmacie::class, mappedBy="produit")
  124.      */
  125.     private $stockpharmacies;
  126.     /**
  127.      * @ORM\Column(type="text", nullable=true)
  128.      */
  129.     private $posologie;
  130.     /**
  131.      * @ORM\Column(type="datetime", nullable=true)
  132.      */
  133.     private $createdAt;
  134.     /**
  135.      * @ORM\Column(type="boolean", nullable=true)
  136.      */
  137.     private $isStockPharmacie;
  138.     /**
  139.      * @ORM\Column(type="boolean", nullable=true)
  140.      */
  141.     private $isOrdonnance;
  142.     /**
  143.      * @ORM\Column(type="boolean", nullable=true)
  144.      */
  145.     private $isPhotoNotFound;
  146.     /**
  147.      * @ORM\Column(type="boolean", nullable=true)
  148.      */
  149.     private $isDoublon;
  150.     /**
  151.      * @ORM\OneToMany(targetEntity=SearchHistory::class, mappedBy="clickAfter")
  152.      */
  153.     private $searchHistories;
  154.     public function __construct()
  155.     {
  156.         $this->propositionDetails = new ArrayCollection();
  157.         $this->orderDetails = new ArrayCollection();
  158.         $this->carts = new ArrayCollection();
  159.         $this->forecastDetails = new ArrayCollection();
  160.         $this->photos = new ArrayCollection();
  161.         $this->stockpharmacies = new ArrayCollection();
  162.         $this->createdAt = new \DateTime();
  163.         $this->searchHistories = new ArrayCollection();
  164.     }
  165.     public function __toString()
  166.     {
  167.         return $this->getName();
  168.     }
  169.     public function getId(): ?int
  170.     {
  171.         return $this->id;
  172.     }
  173.     public function getName(): ?string
  174.     {
  175.         return $this->name;
  176.     }
  177.     public function setName(string $name): self
  178.     {
  179.         $this->name $name;
  180.         return $this;
  181.     }
  182.     public function getDescription(): ?string
  183.     {
  184.         return $this->description;
  185.     }
  186.     public function setDescription(?string $description): self
  187.     {
  188.         $this->description $description;
  189.         return $this;
  190.     }
  191.     public function getCip7(): ?string
  192.     {
  193.         return $this->cip7;
  194.     }
  195.     public function setCip7(?string $cip7): self
  196.     {
  197.         $this->cip7 $cip7;
  198.         return $this;
  199.     }
  200.     public function getCip13(): ?string
  201.     {
  202.         return $this->cip13;
  203.     }
  204.     public function setCip13(?string $cip13): self
  205.     {
  206.         $this->cip13 $cip13;
  207.         return $this;
  208.     }
  209.     public function getPricegrossiste(): ?float
  210.     {
  211.         return $this->pricegrossiste;
  212.     }
  213.     public function setPricegrossiste(?float $pricegrossiste): self
  214.     {
  215.         $this->pricegrossiste $pricegrossiste;
  216.         return $this;
  217.     }
  218.     public function getPricepharmacie(): ?float
  219.     {
  220.         return $this->pricepharmacie;
  221.     }
  222.     public function setPricepharmacie(?float $pricepharmacie): self
  223.     {
  224.         $this->pricepharmacie $pricepharmacie;
  225.         return $this;
  226.     }
  227.     public function getQuantity(): ?int
  228.     {
  229.         return $this->quantity;
  230.     }
  231.     public function setQuantity(?int $quantity): self
  232.     {
  233.         $this->quantity $quantity;
  234.         return $this;
  235.     }
  236.     public function getCollissage(): ?string
  237.     {
  238.         return $this->collissage;
  239.     }
  240.     public function setCollissage(?string $collissage): self
  241.     {
  242.         $this->collissage $collissage;
  243.         return $this;
  244.     }
  245.     public function getQuantitymin(): ?int
  246.     {
  247.         return $this->quantitymin;
  248.     }
  249.     public function setQuantitymin(?int $quantitymin): self
  250.     {
  251.         $this->quantitymin $quantitymin;
  252.         return $this;
  253.     }
  254.     public function getAmm(): ?string
  255.     {
  256.         return $this->amm;
  257.     }
  258.     public function setAmm(?string $amm): self
  259.     {
  260.         $this->amm $amm;
  261.         return $this;
  262.     }
  263.     public function getCg(): ?string
  264.     {
  265.         return $this->cg;
  266.     }
  267.     public function setCg(?string $cg): self
  268.     {
  269.         $this->cg $cg;
  270.         return $this;
  271.     }
  272.     public function getDisponibilite(): ?string
  273.     {
  274.         return $this->disponibilite;
  275.     }
  276.     public function setDisponibilite(?string $disponibilite): self
  277.     {
  278.         $this->disponibilite $disponibilite;
  279.         return $this;
  280.     }
  281.     public function getCategory(): ?Category
  282.     {
  283.         return $this->category;
  284.     }
  285.     public function setCategory(?Category $category): self
  286.     {
  287.         $this->category $category;
  288.         return $this;
  289.     }
  290.     public function getSpecialite(): ?Speciality
  291.     {
  292.         return $this->specialite;
  293.     }
  294.     public function setSpecialite(?Speciality $specialite): self
  295.     {
  296.         $this->specialite $specialite;
  297.         return $this;
  298.     }
  299.     /**
  300.      * @return Collection<int, PropositionDetails>
  301.      */
  302.     public function getPropositionDetails(): Collection
  303.     {
  304.         return $this->propositionDetails;
  305.     }
  306.     public function addPropositionDetail(PropositionDetails $propositionDetail): self
  307.     {
  308.         if (!$this->propositionDetails->contains($propositionDetail)) {
  309.             $this->propositionDetails[] = $propositionDetail;
  310.             $propositionDetail->setProduct($this);
  311.         }
  312.         return $this;
  313.     }
  314.     public function removePropositionDetail(PropositionDetails $propositionDetail): self
  315.     {
  316.         if ($this->propositionDetails->removeElement($propositionDetail)) {
  317.             // set the owning side to null (unless already changed)
  318.             if ($propositionDetail->getProduct() === $this) {
  319.                 $propositionDetail->setProduct(null);
  320.             }
  321.         }
  322.         return $this;
  323.     }
  324.     /**
  325.      * @return Collection<int, OrderDetails>
  326.      */
  327.     public function getOrderDetails(): Collection
  328.     {
  329.         return $this->orderDetails;
  330.     }
  331.     public function addOrderDetail(OrderDetails $orderDetail): self
  332.     {
  333.         if (!$this->orderDetails->contains($orderDetail)) {
  334.             $this->orderDetails[] = $orderDetail;
  335.             $orderDetail->setProductId($this);
  336.         }
  337.         return $this;
  338.     }
  339.     public function removeOrderDetail(OrderDetails $orderDetail): self
  340.     {
  341.         if ($this->orderDetails->removeElement($orderDetail)) {
  342.             // set the owning side to null (unless already changed)
  343.             if ($orderDetail->getProductId() === $this) {
  344.                 $orderDetail->setProductId(null);
  345.             }
  346.         }
  347.         return $this;
  348.     }
  349.     public function getColisageType(): ?ColisageType
  350.     {
  351.         return $this->colisageType;
  352.     }
  353.     public function setColisageType(?ColisageType $colisageType): self
  354.     {
  355.         $this->colisageType $colisageType;
  356.         return $this;
  357.     }
  358.     /**
  359.      * @return Collection<int, Cart>
  360.      */
  361.     public function getCarts(): Collection
  362.     {
  363.         return $this->carts;
  364.     }
  365.     public function addCart(Cart $cart): self
  366.     {
  367.         if (!$this->carts->contains($cart)) {
  368.             $this->carts[] = $cart;
  369.             $cart->setProduit($this);
  370.         }
  371.         return $this;
  372.     }
  373.     public function removeCart(Cart $cart): self
  374.     {
  375.         if ($this->carts->removeElement($cart)) {
  376.             // set the owning side to null (unless already changed)
  377.             if ($cart->getProduit() === $this) {
  378.                 $cart->setProduit(null);
  379.             }
  380.         }
  381.         return $this;
  382.     }
  383.     public function getPays(): ?string
  384.     {
  385.         return $this->pays;
  386.     }
  387.     public function setPays(?string $pays): self
  388.     {
  389.         $this->pays $pays;
  390.         return $this;
  391.     }
  392.     public function getDeclinaisonform(): ?DeclinaisonForm
  393.     {
  394.         return $this->declinaisonform;
  395.     }
  396.     public function setDeclinaisonform(?DeclinaisonForm $declinaisonform): self
  397.     {
  398.         $this->declinaisonform $declinaisonform;
  399.         return $this;
  400.     }
  401.     public function getPrevisionarrivage(): ?int
  402.     {
  403.         return $this->previsionarrivage;
  404.     }
  405.     public function setPrevisionarrivage(?int $previsionarrivage): self
  406.     {
  407.         $this->previsionarrivage $previsionarrivage;
  408.         return $this;
  409.     }
  410.     public function getPayslocalisation(): ?Pays
  411.     {
  412.         return $this->payslocalisation;
  413.     }
  414.     public function setPayslocalisation(?Pays $payslocalisation): self
  415.     {
  416.         $this->payslocalisation $payslocalisation;
  417.         return $this;
  418.     }
  419.     public function getLaboratoire(): ?Laboratoire
  420.     {
  421.         return $this->laboratoire;
  422.     }
  423.     public function setLaboratoire(?Laboratoire $laboratoire): self
  424.     {
  425.         $this->laboratoire $laboratoire;
  426.         return $this;
  427.     }
  428.     public function getIndication(): ?string
  429.     {
  430.         return $this->indication;
  431.     }
  432.     public function setIndication(?string $indication): self
  433.     {
  434.         $this->indication $indication;
  435.         return $this;
  436.     }
  437.     /**
  438.      * @return Collection<int, ForecastDetails>
  439.      */
  440.     public function getForecastDetails(): Collection
  441.     {
  442.         return $this->forecastDetails;
  443.     }
  444.     public function addForecastDetail(ForecastDetails $forecastDetail): self
  445.     {
  446.         if (!$this->forecastDetails->contains($forecastDetail)) {
  447.             $this->forecastDetails[] = $forecastDetail;
  448.             $forecastDetail->setProduitId($this);
  449.         }
  450.         return $this;
  451.     }
  452.     public function removeForecastDetail(ForecastDetails $forecastDetail): self
  453.     {
  454.         if ($this->forecastDetails->removeElement($forecastDetail)) {
  455.             // set the owning side to null (unless already changed)
  456.             if ($forecastDetail->getProduitId() === $this) {
  457.                 $forecastDetail->setProduitId(null);
  458.             }
  459.         }
  460.         return $this;
  461.     }
  462.     /**
  463.      * @return Collection<int, Photo>
  464.      */
  465.     public function getPhotos(): Collection
  466.     {
  467.         return $this->photos;
  468.     }
  469.     public function addPhoto(Photo $photo): self
  470.     {
  471.         if (!$this->photos->contains($photo)) {
  472.             $this->photos[] = $photo;
  473.             $photo->setProduit($this);
  474.         }
  475.         return $this;
  476.     }
  477.     public function removePhoto(Photo $photo): self
  478.     {
  479.         if ($this->photos->removeElement($photo)) {
  480.             // set the owning side to null (unless already changed)
  481.             if ($photo->getProduit() === $this) {
  482.                 $photo->setProduit(null);
  483.             }
  484.         }
  485.         return $this;
  486.     }
  487.     /**
  488.      * @return Collection<int, Stockpharmacie>
  489.      */
  490.     public function getStockpharmacies(): Collection
  491.     {
  492.         return $this->stockpharmacies;
  493.     }
  494.     public function addStockpharmacy(Stockpharmacie $stockpharmacy): self
  495.     {
  496.         if (!$this->stockpharmacies->contains($stockpharmacy)) {
  497.             $this->stockpharmacies[] = $stockpharmacy;
  498.             $stockpharmacy->setProduit($this);
  499.         }
  500.         return $this;
  501.     }
  502.     public function removeStockpharmacy(Stockpharmacie $stockpharmacy): self
  503.     {
  504.         if ($this->stockpharmacies->removeElement($stockpharmacy)) {
  505.             // set the owning side to null (unless already changed)
  506.             if ($stockpharmacy->getProduit() === $this) {
  507.                 $stockpharmacy->setProduit(null);
  508.             }
  509.         }
  510.         return $this;
  511.     }
  512.     public function getPosologie(): ?string
  513.     {
  514.         return $this->posologie;
  515.     }
  516.     public function setPosologie(?string $posologie): self
  517.     {
  518.         $this->posologie $posologie;
  519.         return $this;
  520.     }
  521.     public function getCreatedAt(): ?\DateTimeInterface
  522.     {
  523.         return $this->createdAt;
  524.     }
  525.     public function setCreatedAt(?\DateTimeInterface $createdAt): self
  526.     {
  527.         $this->createdAt $createdAt;
  528.         return $this;
  529.     }
  530.     public function isIsStockPharmacie(): ?bool
  531.     {
  532.         return $this->isStockPharmacie;
  533.     }
  534.     public function setIsStockPharmacie(?bool $isStockPharmacie): self
  535.     {
  536.         $this->isStockPharmacie $isStockPharmacie;
  537.         return $this;
  538.     }
  539.     public function isIsOrdonnance(): ?bool
  540.     {
  541.         return $this->isOrdonnance;
  542.     }
  543.     public function setIsOrdonnance(?bool $isOrdonnance): self
  544.     {
  545.         $this->isOrdonnance $isOrdonnance;
  546.         return $this;
  547.     }
  548.     public function isIsPhotoNotFound(): ?bool
  549.     {
  550.         return $this->isPhotoNotFound;
  551.     }
  552.     public function setIsPhotoNotFound(?bool $isPhotoNotFound): self
  553.     {
  554.         $this->isPhotoNotFound $isPhotoNotFound;
  555.         return $this;
  556.     }
  557.     public function isIsDoublon(): ?bool
  558.     {
  559.         return $this->isDoublon;
  560.     }
  561.     public function setIsDoublon(?bool $isDoublon): self
  562.     {
  563.         $this->isDoublon $isDoublon;
  564.         return $this;
  565.     }
  566.     /**
  567.      * @return Collection<int, SearchHistory>
  568.      */
  569.     public function getSearchHistories(): Collection
  570.     {
  571.         return $this->searchHistories;
  572.     }
  573.     public function addSearchHistory(SearchHistory $searchHistory): self
  574.     {
  575.         if (!$this->searchHistories->contains($searchHistory)) {
  576.             $this->searchHistories[] = $searchHistory;
  577.             $searchHistory->setClickAfter($this);
  578.         }
  579.         return $this;
  580.     }
  581.     public function removeSearchHistory(SearchHistory $searchHistory): self
  582.     {
  583.         if ($this->searchHistories->removeElement($searchHistory)) {
  584.             // set the owning side to null (unless already changed)
  585.             if ($searchHistory->getClickAfter() === $this) {
  586.                 $searchHistory->setClickAfter(null);
  587.             }
  588.         }
  589.         return $this;
  590.     }
  591. }