Deprecated: Constant E_STRICT is deprecated in /var/www/PixelForce/vendor/symfony/error-handler/ErrorHandler.php on line 58

Deprecated: Constant E_STRICT is deprecated in /var/www/PixelForce/vendor/symfony/error-handler/ErrorHandler.php on line 76
Symfony Profiler

src/Entity/OrderSecuAccomp.php line 103

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\OrderSecuAccompRepository;
  4. use Doctrine\ORM\EntityManagerInterface;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use JsonSerializable;
  7. /**
  8.  * @ORM\Entity(repositoryClass=OrderSecuAccompRepository::class)
  9.  */
  10. class OrderSecuAccomp implements JsonSerializable
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\ManyToOne(targetEntity=ProduitSecuAccomp::class)
  20.      * @ORM\JoinColumn(nullable=false)
  21.      */
  22.     private $produit;
  23.     /**
  24.      * @ORM\Column(type="integer")
  25.      */
  26.     private $qte;
  27.     /**
  28.      * @ORM\Column(type="float")
  29.      */
  30.     private $prix;
  31.     /**
  32.      * @ORM\ManyToOne(targetEntity=OrderSecu::class, inversedBy="accomps")
  33.      * @ORM\JoinColumn(nullable=false)
  34.      */
  35.     private $orderSecu;
  36.     public function getId(): ?int
  37.     {
  38.         return $this->id;
  39.     }
  40.     public function getProduit(): ?ProduitSecuAccomp
  41.     {
  42.         return $this->produit;
  43.     }
  44.     public function setProduit(?ProduitSecuAccomp $produit): self
  45.     {
  46.         $this->produit $produit;
  47.         return $this;
  48.     }
  49.     public function getQte(): ?int
  50.     {
  51.         return $this->qte;
  52.     }
  53.     public function setQte(int $qte): self
  54.     {
  55.         $this->qte $qte;
  56.         return $this;
  57.     }
  58.     public function getPrix(): ?float
  59.     {
  60.         return $this->prix;
  61.     }
  62.     public function setPrix(float $prix): self
  63.     {
  64.         $this->prix $prix;
  65.         return $this;
  66.     }
  67.     public function getOrderSecu(): ?OrderSecu
  68.     {
  69.         return $this->orderSecu;
  70.     }
  71.     public function setOrderSecu(?OrderSecu $orderSecu): self
  72.     {
  73.         $this->orderSecu $orderSecu;
  74.         return $this;
  75.     }
  76.     public function getMontant(){
  77.         return $this->getProduit()->getPrix() * $this->getQte();
  78.     }
  79.     public function jsonSerialize()
  80.     {
  81.         $vars get_object_vars($this);
  82.         return $vars;
  83.     }
  84.     public function refresh(EntityManagerInterface $em){
  85.         if($this->getProduit()){
  86.             $this->setProduit($em->getRepository(ProduitSecuAccomp::class)->find($this->getProduit()->getId()));
  87.         }
  88.         
  89.     }
  90. }