src/Entity/TblDetailQuantiteParcelle.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\TblDetailQuantiteParcelleRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use App\Entity\Traits\TimestampableTrait;
  6. use App\Validator as DetailQuantiteAssert;
  7. use Gedmo\Mapping\Annotation as Gedmo;
  8. /**
  9.  * @ORM\Entity(repositoryClass=TblDetailQuantiteParcelleRepository::class)
  10.  * @DetailQuantiteAssert\DetailQuantite
  11.  * @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false, hardDelete=false) 
  12.  */
  13. class TblDetailQuantiteParcelle
  14. {
  15.     /**
  16.      * @ORM\Id
  17.      * @ORM\GeneratedValue
  18.      * @ORM\Column(type="integer")
  19.      */
  20.     private $id;
  21.     /**
  22.      * @ORM\ManyToOne(targetEntity=TblParcelle::class, inversedBy="detailQuantiteParcelles")
  23.      */
  24.     private $parcelle;
  25.     /**
  26.      * @ORM\Column(type="float")
  27.      */
  28.     private $caisse;
  29.     /**
  30.      * @ORM\ManyToOne(targetEntity=TblOperationVente::class, inversedBy="detailQuantiteParcelle" )
  31.      */
  32.     private $tblOperationVente;
  33.     /**
  34.      * @ORM\Column(type="float", nullable=true)
  35.      */
  36.     private $quantite;
  37.     /**
  38.      * @ORM\ManyToOne(targetEntity=RefTypeProduit::class, inversedBy="tblDetailQuantiteParcelles")
  39.      * @ORM\JoinColumn(nullable=false)
  40.      */
  41.     private $typeProduit;
  42.     /**
  43.      * @ORM\OneToOne(targetEntity=TblMouvement::class, inversedBy="tblDetailQuantiteParcelle", cascade={"persist", "remove"})
  44.      */
  45.     private $mouvement;
  46.     use TimestampableTrait;
  47.     public function getId(): ?int
  48.     {
  49.         return $this->id;
  50.     }
  51.     
  52.     public function toArrayDatatable($urlEdit )
  53.     {
  54.         return [
  55.             $this->getCreatedAt()->format('d/m/Y'),
  56.             $this->getParcelle()->__toString(),
  57.             $this->getTypeProduit()->__toString(),
  58.             $this->getCaisse(),
  59.             $this->getQuantite().' '.$this->getTypeProduit()->getUnite(),
  60.             $this->$urlEdit ='<button class="btn btn-primary"   data-action="click->form-vente#openModalEdit" data-venteid='$this->getId() .' title="Modifier" ><i class="ti ti-edit"></i></button>',
  61.         ];
  62.     }
  63.     
  64.     public function getParcelle(): ?TblParcelle
  65.     {
  66.         return $this->parcelle;
  67.     }
  68.     public function setParcelle(?TblParcelle $parcelle): self
  69.     {
  70.         $this->parcelle $parcelle;
  71.         return $this;
  72.     }
  73.     public function getCaisse(): ?float
  74.     {
  75.         return $this->caisse;
  76.     }
  77.     public function setCaisse(float $caisse): self
  78.     {
  79.         $this->caisse $caisse;
  80.         return $this;
  81.     }
  82.     public function getTblOperationVente(): ?TblOperationVente
  83.     {
  84.         return $this->tblOperationVente;
  85.     }
  86.     public function setTblOperationVente(?TblOperationVente $tblOperationVente): self
  87.     {
  88.         $this->tblOperationVente $tblOperationVente;
  89.         return $this;
  90.     }
  91.     public function getQuantite(): ?float
  92.     {
  93.         return $this->quantite;
  94.     }
  95.     public function setQuantite(?float $quantite): self
  96.     {
  97.         $this->quantite $quantite;
  98.         return $this;
  99.     }
  100.     public function getTypeProduit(): ?RefTypeProduit
  101.     {
  102.         return $this->typeProduit;
  103.     }
  104.     public function setTypeProduit(?RefTypeProduit $typeProduit): self
  105.     {
  106.         $this->typeProduit $typeProduit;
  107.         return $this;
  108.     }
  109.     public function getMouvement(): ?TblMouvement
  110.     {
  111.         return $this->mouvement;
  112.     }
  113.     public function setMouvement(?TblMouvement $mouvement): self
  114.     {
  115.         $this->mouvement $mouvement;
  116.         return $this;
  117.     }
  118. }