<?php
namespace App\Entity;
use App\Repository\StockpharmacieRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=StockpharmacieRepository::class)
* @ORM\HasLifecycleCallbacks
*/
class Stockpharmacie
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $nomproduit;
/**
* @ORM\Column(type="string", length=255,nullable=true)
*/
private $cip7;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $cip13;
/**
* @ORM\ManyToOne(targetEntity=User::class, inversedBy="stockpharmacies")
* @ORM\JoinColumn(nullable=false)
*/
private $user;
/**
* @ORM\ManyToOne(targetEntity=IctusPharmacie::class, inversedBy="stockpharmacies")
*/
private $ictuspharmacie;
/**
* @ORM\ManyToOne(targetEntity=IctusForme::class, inversedBy="stockpharmacies")
*/
private $ictusforme;
/**
* @ORM\Column(type="string", length=50, nullable=true)
*/
private $uuid;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $description;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $posologie;
/**
* @ORM\Column(type="float", nullable=true)
*/
private $poids;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $isDisponible;
/**
* @ORM\Column(type="float", nullable=true)
*/
private $prixunitforme;
/**
* @ORM\Column(type="float", nullable=true)
*/
private $remise;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $dateFinRemise;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $quantite;
/**
* @ORM\ManyToOne(targetEntity=Product::class, inversedBy="stockpharmacies")
*/
private $produit;
/**
* @ORM\OneToMany(targetEntity=IctusPanierPatient::class, mappedBy="produit_stock_pcie", cascade={"remove"})
*/
private $ictusPanierPatients;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $tva;
/**
* @ORM\OneToMany(targetEntity=IctusCommandeLine::class, mappedBy="stockPharmacieProduit")
*/
private $ictusCommandeLines;
/**
* @ORM\Column(type="datetime")
*/
private $created_at;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $modified_at;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $isOrdonnance;
public function __construct()
{
$this->uuid = uniqid((new \DateTime())->format('YmdHis'));
$this->created_at = new \DateTime();
$this->ictusPanierPatients = new ArrayCollection();
$this->ictusCommandeLines = new ArrayCollection();
}
/**
* Undocumented function
*
* @ORM\PrePersist
* @ORM\PreUpdate
*/
public function initialiseSlug()
{
$this->modified_at = new \DateTime();
}
public function getId(): ?int
{
return $this->id;
}
public function getNomproduit(): ?string
{
return $this->nomproduit;
}
public function setNomproduit(string $nomproduit): self
{
$this->nomproduit = $nomproduit;
return $this;
}
public function getCip7(): ?string
{
return $this->cip7;
}
public function setCip7(?string $cip7): self
{
$this->cip7 = $cip7;
return $this;
}
public function getCip13(): ?string
{
return $this->cip13;
}
public function setCip13(?string $cip13): self
{
$this->cip13 = $cip13;
return $this;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): self
{
$this->user = $user;
return $this;
}
public function getIctuspharmacie(): ?IctusPharmacie
{
return $this->ictuspharmacie;
}
public function setIctuspharmacie(?IctusPharmacie $ictuspharmacie): self
{
$this->ictuspharmacie = $ictuspharmacie;
return $this;
}
public function getIctusforme(): ?IctusForme
{
return $this->ictusforme;
}
public function setIctusforme(?IctusForme $ictusforme): self
{
$this->ictusforme = $ictusforme;
return $this;
}
public function getUuid(): ?string
{
return $this->uuid;
}
public function setUuid(?string $uuid): self
{
$this->uuid = $uuid;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
public function getPosologie(): ?string
{
return $this->posologie;
}
public function setPosologie(?string $posologie): self
{
$this->posologie = $posologie;
return $this;
}
public function getPoids(): ?float
{
return $this->poids;
}
public function setPoids(?float $poids): self
{
$this->poids = $poids;
return $this;
}
public function isIsDisponible(): ?bool
{
return $this->isDisponible;
}
public function setIsDisponible(?bool $isDisponible): self
{
$this->isDisponible = $isDisponible;
return $this;
}
public function getPrixunitforme(): ?float
{
return $this->prixunitforme;
}
public function setPrixunitforme(?float $prixunitforme): self
{
$this->prixunitforme = $prixunitforme;
return $this;
}
public function getRemise(): ?float
{
return $this->remise;
}
public function setRemise(?float $remise): self
{
$this->remise = $remise;
return $this;
}
public function getDateFinRemise(): ?\DateTimeInterface
{
return $this->dateFinRemise;
}
public function setDateFinRemise(?\DateTimeInterface $dateFinRemise): self
{
$this->dateFinRemise = $dateFinRemise;
return $this;
}
public function getQuantite(): ?int
{
return $this->quantite;
}
public function setQuantite(?int $quantite): self
{
$this->quantite = $quantite;
return $this;
}
public function getProduit(): ?Product
{
return $this->produit;
}
public function setProduit(?Product $produit): self
{
$this->produit = $produit;
return $this;
}
/**
* @return Collection<int, IctusPanierPatient>
*/
public function getIctusPanierPatients(): Collection
{
return $this->ictusPanierPatients;
}
public function addIctusPanierPatient(IctusPanierPatient $ictusPanierPatient): self
{
if (!$this->ictusPanierPatients->contains($ictusPanierPatient)) {
$this->ictusPanierPatients[] = $ictusPanierPatient;
$ictusPanierPatient->setProduitStockPcie($this);
}
return $this;
}
public function removeIctusPanierPatient(IctusPanierPatient $ictusPanierPatient): self
{
if ($this->ictusPanierPatients->removeElement($ictusPanierPatient)) {
// set the owning side to null (unless already changed)
if ($ictusPanierPatient->getProduitStockPcie() === $this) {
$ictusPanierPatient->setProduitStockPcie(null);
}
}
return $this;
}
public function getTva(): ?int
{
return $this->tva;
}
public function setTva(?int $tva): self
{
$this->tva = $tva;
return $this;
}
/**
* @return Collection<int, IctusCommandeLine>
*/
public function getIctusCommandeLines(): Collection
{
return $this->ictusCommandeLines;
}
public function addIctusCommandeLine(IctusCommandeLine $ictusCommandeLine): self
{
if (!$this->ictusCommandeLines->contains($ictusCommandeLine)) {
$this->ictusCommandeLines[] = $ictusCommandeLine;
$ictusCommandeLine->setStockPharmacieProduit($this);
}
return $this;
}
public function removeIctusCommandeLine(IctusCommandeLine $ictusCommandeLine): self
{
if ($this->ictusCommandeLines->removeElement($ictusCommandeLine)) {
// set the owning side to null (unless already changed)
if ($ictusCommandeLine->getStockPharmacieProduit() === $this) {
$ictusCommandeLine->setStockPharmacieProduit(null);
}
}
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->created_at;
}
public function setCreatedAt(\DateTimeInterface $created_at): self
{
$this->created_at = $created_at;
return $this;
}
public function getModifiedAt(): ?\DateTimeInterface
{
return $this->modified_at;
}
public function setModifiedAt(\DateTimeInterface $modified_at): self
{
$this->modified_at = $modified_at;
return $this;
}
public function isIsOrdonnance(): ?bool
{
return $this->isOrdonnance;
}
public function setIsOrdonnance(?bool $isOrdonnance): self
{
$this->isOrdonnance = $isOrdonnance;
return $this;
}
}