src/Entity/Stockpharmacie.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Doctrine\Common\Collections\Collection;
  5. use App\Repository\StockpharmacieRepository;
  6. use Doctrine\Common\Collections\ArrayCollection;
  7. /**
  8.  * @ORM\Entity(repositoryClass=StockpharmacieRepository::class)
  9.  * @ORM\HasLifecycleCallbacks
  10.  */
  11. class Stockpharmacie
  12. {
  13.     /**
  14.     * @ORM\Id()
  15.     * @ORM\GeneratedValue()
  16.     * @ORM\Column(type="integer")
  17.     */
  18.      private $id;
  19.     /**
  20.      * @ORM\Column(type="string", length=255)
  21.      */
  22.     private $nomproduit;
  23.     /**
  24.      * @ORM\Column(type="string", length=255,nullable=true)
  25.      */
  26.     private $cip7;
  27.     /**
  28.      * @ORM\Column(type="string", length=255, nullable=true)
  29.      */
  30.     private $cip13;
  31.     /**
  32.      * @ORM\ManyToOne(targetEntity=User::class, inversedBy="stockpharmacies")
  33.      * @ORM\JoinColumn(nullable=false)
  34.      */
  35.     private $user;
  36.     /**
  37.      * @ORM\ManyToOne(targetEntity=IctusPharmacie::class, inversedBy="stockpharmacies")
  38.      */
  39.     private $ictuspharmacie;
  40.     /**
  41.      * @ORM\ManyToOne(targetEntity=IctusForme::class, inversedBy="stockpharmacies")
  42.      */
  43.     private $ictusforme;
  44.     /**
  45.      * @ORM\Column(type="string", length=50, nullable=true)
  46.      */
  47.     private $uuid;
  48.     /**
  49.      * @ORM\Column(type="string", length=255, nullable=true)
  50.      */
  51.     private $description;
  52.     /**
  53.      * @ORM\Column(type="text", nullable=true)
  54.      */
  55.     private $posologie;
  56.     /**
  57.      * @ORM\Column(type="float", nullable=true)
  58.      */
  59.     private $poids;
  60.     /**
  61.      * @ORM\Column(type="boolean", nullable=true)
  62.      */
  63.     private $isDisponible;
  64.     /**
  65.      * @ORM\Column(type="float", nullable=true)
  66.      */
  67.     private $prixunitforme;
  68.     /**
  69.      * @ORM\Column(type="float", nullable=true)
  70.      */
  71.     private $remise;
  72.     /**
  73.      * @ORM\Column(type="datetime", nullable=true)
  74.      */
  75.     private $dateFinRemise;
  76.     /**
  77.      * @ORM\Column(type="integer", nullable=true)
  78.      */
  79.     private $quantite;
  80.     /**
  81.      * @ORM\ManyToOne(targetEntity=Product::class, inversedBy="stockpharmacies")
  82.      */
  83.     private $produit;
  84.     /**
  85.      * @ORM\OneToMany(targetEntity=IctusPanierPatient::class, mappedBy="produit_stock_pcie", cascade={"remove"})
  86.      */
  87.     private $ictusPanierPatients;
  88.     /**
  89.      * @ORM\Column(type="integer", nullable=true)
  90.      */
  91.     private $tva;
  92.     /**
  93.      * @ORM\OneToMany(targetEntity=IctusCommandeLine::class, mappedBy="stockPharmacieProduit")
  94.      */
  95.     private $ictusCommandeLines;
  96.     /**
  97.      * @ORM\Column(type="datetime")
  98.      */
  99.     private $created_at;
  100.     /**
  101.      * @ORM\Column(type="datetime", nullable=true)
  102.      */
  103.     private $modified_at;
  104.     /**
  105.      * @ORM\Column(type="boolean", nullable=true)
  106.      */
  107.     private $isOrdonnance;
  108.     /**
  109.      * @ORM\OneToMany(targetEntity=Favorite::class, mappedBy="stockPharmacie")
  110.      */
  111.     private $favorites;
  112.     public function __construct()
  113.     {
  114.         $this->uuid   uniqid((new \DateTime())->format('YmdHis'));
  115.         $this->created_at = new \DateTime();
  116.         $this->ictusPanierPatients = new ArrayCollection();
  117.         $this->ictusCommandeLines = new ArrayCollection();
  118.         $this->favorites = new ArrayCollection();
  119.     }
  120.     /**
  121.      * Undocumented function
  122.      *
  123.      * @ORM\PrePersist
  124.      * @ORM\PreUpdate
  125.      */
  126.     public function initialiseSlug()
  127.     {
  128.         $this->modified_at = new \DateTime();
  129.     }
  130.     public function getId(): ?int
  131.     {
  132.         return $this->id;
  133.     }
  134.     public function getNomproduit(): ?string
  135.     {
  136.         return $this->nomproduit;
  137.     }
  138.     public function setNomproduit(string $nomproduit): self
  139.     {
  140.         $this->nomproduit $nomproduit;
  141.         return $this;
  142.     }
  143.     public function getCip7(): ?string
  144.     {
  145.         return $this->cip7;
  146.     }
  147.     public function setCip7(?string $cip7): self
  148.     {
  149.         $this->cip7 $cip7;
  150.         return $this;
  151.     }
  152.     public function getCip13(): ?string
  153.     {
  154.         return $this->cip13;
  155.     }
  156.     public function setCip13(?string $cip13): self
  157.     {
  158.         $this->cip13 $cip13;
  159.         return $this;
  160.     }
  161.     public function getUser(): ?User
  162.     {
  163.         return $this->user;
  164.     }
  165.     public function setUser(?User $user): self
  166.     {
  167.         $this->user $user;
  168.         return $this;
  169.     }
  170.     public function getIctuspharmacie(): ?IctusPharmacie
  171.     {
  172.         return $this->ictuspharmacie;
  173.     }
  174.     public function setIctuspharmacie(?IctusPharmacie $ictuspharmacie): self
  175.     {
  176.         $this->ictuspharmacie $ictuspharmacie;
  177.         return $this;
  178.     }
  179.     public function getIctusforme(): ?IctusForme
  180.     {
  181.         return $this->ictusforme;
  182.     }
  183.     public function setIctusforme(?IctusForme $ictusforme): self
  184.     {
  185.         $this->ictusforme $ictusforme;
  186.         return $this;
  187.     }
  188.     public function getUuid(): ?string
  189.     {
  190.         return $this->uuid;
  191.     }
  192.     public function setUuid(?string $uuid): self
  193.     {
  194.         $this->uuid $uuid;
  195.         return $this;
  196.     }
  197.     public function getDescription(): ?string
  198.     {
  199.         return $this->description;
  200.     }
  201.     public function setDescription(?string $description): self
  202.     {
  203.         $this->description $description;
  204.         return $this;
  205.     }
  206.     public function getPosologie(): ?string
  207.     {
  208.         return $this->posologie;
  209.     }
  210.     public function setPosologie(?string $posologie): self
  211.     {
  212.         $this->posologie $posologie;
  213.         return $this;
  214.     }
  215.     public function getPoids(): ?float
  216.     {
  217.         return $this->poids;
  218.     }
  219.     public function setPoids(?float $poids): self
  220.     {
  221.         $this->poids $poids;
  222.         return $this;
  223.     }
  224.     public function isIsDisponible(): ?bool
  225.     {
  226.         return $this->isDisponible;
  227.     }
  228.     public function setIsDisponible(?bool $isDisponible): self
  229.     {
  230.         $this->isDisponible $isDisponible;
  231.         return $this;
  232.     }
  233.     public function getPrixunitforme(): ?float
  234.     {
  235.         return $this->prixunitforme;
  236.     }
  237.     public function setPrixunitforme(?float $prixunitforme): self
  238.     {
  239.         $this->prixunitforme $prixunitforme;
  240.         return $this;
  241.     }
  242.     public function getRemise(): ?float
  243.     {
  244.         return $this->remise;
  245.     }
  246.     public function setRemise(?float $remise): self
  247.     {
  248.         $this->remise $remise;
  249.         return $this;
  250.     }
  251.     public function getDateFinRemise(): ?\DateTimeInterface
  252.     {
  253.         return $this->dateFinRemise;
  254.     }
  255.     public function setDateFinRemise(?\DateTimeInterface $dateFinRemise): self
  256.     {
  257.         $this->dateFinRemise $dateFinRemise;
  258.         return $this;
  259.     }
  260.     public function getQuantite(): ?int
  261.     {
  262.         return $this->quantite;
  263.     }
  264.     public function setQuantite(?int $quantite): self
  265.     {
  266.         $this->quantite $quantite;
  267.         return $this;
  268.     }
  269.     public function getProduit(): ?Product
  270.     {
  271.         return $this->produit;
  272.     }
  273.     public function setProduit(?Product $produit): self
  274.     {
  275.         $this->produit $produit;
  276.         return $this;
  277.     }
  278.     /**
  279.      * @return Collection<int, IctusPanierPatient>
  280.      */
  281.     public function getIctusPanierPatients(): Collection
  282.     {
  283.         return $this->ictusPanierPatients;
  284.     }
  285.     public function addIctusPanierPatient(IctusPanierPatient $ictusPanierPatient): self
  286.     {
  287.         if (!$this->ictusPanierPatients->contains($ictusPanierPatient)) {
  288.             $this->ictusPanierPatients[] = $ictusPanierPatient;
  289.             $ictusPanierPatient->setProduitStockPcie($this);
  290.         }
  291.         return $this;
  292.     }
  293.     public function removeIctusPanierPatient(IctusPanierPatient $ictusPanierPatient): self
  294.     {
  295.         if ($this->ictusPanierPatients->removeElement($ictusPanierPatient)) {
  296.             // set the owning side to null (unless already changed)
  297.             if ($ictusPanierPatient->getProduitStockPcie() === $this) {
  298.                 $ictusPanierPatient->setProduitStockPcie(null);
  299.             }
  300.         }
  301.         return $this;
  302.     }
  303.     public function getTva(): ?int
  304.     {
  305.         return $this->tva;
  306.     }
  307.     public function setTva(?int $tva): self
  308.     {
  309.         $this->tva $tva;
  310.         return $this;
  311.     }
  312.     /**
  313.      * @return Collection<int, IctusCommandeLine>
  314.      */
  315.     public function getIctusCommandeLines(): Collection
  316.     {
  317.         return $this->ictusCommandeLines;
  318.     }
  319.     public function addIctusCommandeLine(IctusCommandeLine $ictusCommandeLine): self
  320.     {
  321.         if (!$this->ictusCommandeLines->contains($ictusCommandeLine)) {
  322.             $this->ictusCommandeLines[] = $ictusCommandeLine;
  323.             $ictusCommandeLine->setStockPharmacieProduit($this);
  324.         }
  325.         return $this;
  326.     }
  327.     public function removeIctusCommandeLine(IctusCommandeLine $ictusCommandeLine): self
  328.     {
  329.         if ($this->ictusCommandeLines->removeElement($ictusCommandeLine)) {
  330.             // set the owning side to null (unless already changed)
  331.             if ($ictusCommandeLine->getStockPharmacieProduit() === $this) {
  332.                 $ictusCommandeLine->setStockPharmacieProduit(null);
  333.             }
  334.         }
  335.         return $this;
  336.     }
  337.     public function getCreatedAt(): ?\DateTimeInterface
  338.     {
  339.         return $this->created_at;
  340.     }
  341.     public function setCreatedAt(\DateTimeInterface $created_at): self
  342.     {
  343.         $this->created_at $created_at;
  344.         return $this;
  345.     }
  346.     public function getModifiedAt(): ?\DateTimeInterface
  347.     {
  348.         return $this->modified_at;
  349.     }
  350.     public function setModifiedAt(\DateTimeInterface $modified_at): self
  351.     {
  352.         $this->modified_at $modified_at;
  353.         return $this;
  354.     }
  355.     public function isIsOrdonnance(): ?bool
  356.     {
  357.         return $this->isOrdonnance;
  358.     }
  359.     public function setIsOrdonnance(?bool $isOrdonnance): self
  360.     {
  361.         $this->isOrdonnance $isOrdonnance;
  362.         return $this;
  363.     }
  364.     /**
  365.      * @return Collection<int, Favorite>
  366.      */
  367.     public function getFavorites(): Collection
  368.     {
  369.         return $this->favorites;
  370.     }
  371.     public function addFavorite(Favorite $favorite): self
  372.     {
  373.         if (!$this->favorites->contains($favorite)) {
  374.             $this->favorites[] = $favorite;
  375.             $favorite->setStockPharmacie($this);
  376.         }
  377.         return $this;
  378.     }
  379.     public function removeFavorite(Favorite $favorite): self
  380.     {
  381.         if ($this->favorites->removeElement($favorite)) {
  382.             // set the owning side to null (unless already changed)
  383.             if ($favorite->getStockPharmacie() === $this) {
  384.                 $favorite->setStockPharmacie(null);
  385.             }
  386.         }
  387.         return $this;
  388.     }
  389.     public function isMyFavorite(User $user): bool
  390.     {
  391.         foreach ($this->favorites as $favorite) {
  392.             if ($favorite->getUser() === $user) {
  393.                 return true;
  394.             }
  395.         }
  396.         return false;
  397.     }
  398. }