src/Entity/IctusPanierPatient.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Ordonnance;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use App\Repository\IctusPanierPatientRepository;
  6. /**
  7.  * @ORM\Entity(repositoryClass=IctusPanierPatientRepository::class)
  8.  */
  9. class IctusPanierPatient
  10. {
  11.     /**
  12.      * @ORM\Id
  13.      * @ORM\GeneratedValue
  14.      * @ORM\Column(type="integer")
  15.      */
  16.     private $id;
  17.     /**
  18.      * @ORM\Column(type="integer")
  19.      */
  20.     private $quantite;
  21.     /**
  22.      * @ORM\Column(type="datetime")
  23.      */
  24.     private $created_at;
  25.     /**
  26.      * @ORM\ManyToOne(targetEntity=Stockpharmacie::class, inversedBy="ictusPanierPatients")
  27.      * @ORM\JoinColumn(name="produit_stock_pcie_id", referencedColumnName="id", onDelete="CASCADE")
  28.      */
  29.     private $produit_stock_pcie;
  30.     /**
  31.      * @ORM\ManyToOne(targetEntity=User::class, inversedBy="ictusPanierPatients")
  32.      */
  33.     private $user;
  34.     /**
  35.      * @ORM\Column(type="float", nullable=true)
  36.      */
  37.     private $total;
  38.     /**
  39.      * @ORM\Column(type="float", nullable=true)
  40.      */
  41.     private $prix_unitaire;
  42.     /**
  43.      * @ORM\ManyToOne(targetEntity=Ordonnance::class, inversedBy="ictusPanierPatients")
  44.      * @ORM\JoinColumn(name="ordonnance_id", referencedColumnName="id", onDelete="CASCADE")
  45.      */
  46.     private $ordonnance;
  47.     public function __construct()
  48.     {
  49.         $this->created_at = new \DateTime();
  50.     }
  51.     public function getId(): ?int
  52.     {
  53.         return $this->id;
  54.     }
  55.     public function getQuantite(): ?int
  56.     {
  57.         return $this->quantite;
  58.     }
  59.     public function setQuantite(int $quantite): self
  60.     {
  61.         $this->quantite $quantite;
  62.         return $this;
  63.     }
  64.     public function getCreatedAt(): ?\DateTimeInterface
  65.     {
  66.         return $this->created_at;
  67.     }
  68.     public function setCreatedAt(\DateTimeInterface $created_at): self
  69.     {
  70.         $this->created_at $created_at;
  71.         return $this;
  72.     }
  73.     public function getProduitStockPcie(): ?Stockpharmacie
  74.     {
  75.         return $this->produit_stock_pcie;
  76.     }
  77.     public function setProduitStockPcie(?Stockpharmacie $produit_stock_pcie): self
  78.     {
  79.         $this->produit_stock_pcie $produit_stock_pcie;
  80.         return $this;
  81.     }
  82.     public function getUser(): ?User
  83.     {
  84.         return $this->user;
  85.     }
  86.     public function setUser(?User $user): self
  87.     {
  88.         $this->user $user;
  89.         return $this;
  90.     }
  91.     public function getTotal(): ?float
  92.     {
  93.         return $this->total;
  94.     }
  95.     public function setTotal(?float $total): self
  96.     {
  97.         $this->total $total;
  98.         return $this;
  99.     }
  100.     public function getPrixUnitaire(): ?float
  101.     {
  102.         return $this->prix_unitaire;
  103.     }
  104.     public function setPrixUnitaire(?float $prix_unitaire): self
  105.     {
  106.         $this->prix_unitaire $prix_unitaire;
  107.         return $this;
  108.     }
  109.     public function getPrixTotal(){
  110.         return (float)($this->getTotal() * $this->getPrixUnitaire());
  111.     }
  112.     public function getOrdonnance(): ?Ordonnance
  113.     {
  114.         return $this->ordonnance;
  115.     }
  116.     public function setOrdonnance(?Ordonnance $ordonnance): self
  117.     {
  118.         $this->ordonnance $ordonnance;
  119.         return $this;
  120.     }
  121. }