<?php
namespace App\Entity;
use App\Repository\TblDetailQuantiteParcelleRepository;
use Doctrine\ORM\Mapping as ORM;
use App\Entity\Traits\TimestampableTrait;
use App\Validator as DetailQuantiteAssert;
use Gedmo\Mapping\Annotation as Gedmo;
/**
* @ORM\Entity(repositoryClass=TblDetailQuantiteParcelleRepository::class)
* @DetailQuantiteAssert\DetailQuantite
* @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false, hardDelete=false)
*/
class TblDetailQuantiteParcelle
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity=TblParcelle::class, inversedBy="detailQuantiteParcelles")
*/
private $parcelle;
/**
* @ORM\Column(type="float")
*/
private $caisse;
/**
* @ORM\ManyToOne(targetEntity=TblOperationVente::class, inversedBy="detailQuantiteParcelle" )
*/
private $tblOperationVente;
/**
* @ORM\Column(type="float", nullable=true)
*/
private $quantite;
/**
* @ORM\ManyToOne(targetEntity=RefTypeProduit::class, inversedBy="tblDetailQuantiteParcelles")
* @ORM\JoinColumn(nullable=false)
*/
private $typeProduit;
/**
* @ORM\OneToOne(targetEntity=TblMouvement::class, inversedBy="tblDetailQuantiteParcelle", cascade={"persist", "remove"})
*/
private $mouvement;
use TimestampableTrait;
public function getId(): ?int
{
return $this->id;
}
public function toArrayDatatable($urlEdit )
{
return [
$this->getCreatedAt()->format('d/m/Y'),
$this->getParcelle()->__toString(),
$this->getTypeProduit()->__toString(),
$this->getCaisse(),
$this->getQuantite().' '.$this->getTypeProduit()->getUnite(),
$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>',
];
}
public function getParcelle(): ?TblParcelle
{
return $this->parcelle;
}
public function setParcelle(?TblParcelle $parcelle): self
{
$this->parcelle = $parcelle;
return $this;
}
public function getCaisse(): ?float
{
return $this->caisse;
}
public function setCaisse(float $caisse): self
{
$this->caisse = $caisse;
return $this;
}
public function getTblOperationVente(): ?TblOperationVente
{
return $this->tblOperationVente;
}
public function setTblOperationVente(?TblOperationVente $tblOperationVente): self
{
$this->tblOperationVente = $tblOperationVente;
return $this;
}
public function getQuantite(): ?float
{
return $this->quantite;
}
public function setQuantite(?float $quantite): self
{
$this->quantite = $quantite;
return $this;
}
public function getTypeProduit(): ?RefTypeProduit
{
return $this->typeProduit;
}
public function setTypeProduit(?RefTypeProduit $typeProduit): self
{
$this->typeProduit = $typeProduit;
return $this;
}
public function getMouvement(): ?TblMouvement
{
return $this->mouvement;
}
public function setMouvement(?TblMouvement $mouvement): self
{
$this->mouvement = $mouvement;
return $this;
}
}