<?php
namespace App\Entity\GestionComerciale;
use App\Entity\Utilisateur\Utilisateur;
use DateTime;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Component\Validator\ExecutionContextInterface;
use App\Annotations\SecuredEntity;
/**
* ModeEncaissement
*
* @ORM\Table("commerciale__mode_encaissement")
* @ORM\Entity(repositoryClass="App\Repository\GestionComerciale\ModeEncaissementRepository")
* @Gedmo\SoftDeleteable(fieldName="dateSuppression",timeAware=false)
* @SecuredEntity(name="Mode d'encaissement", group="REGLAGES")
*
*/
class ModeEncaissement
{
/**
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Utilisateur\Utilisateur", inversedBy="modeEncaissement")
* @ORM\JoinColumn(nullable=true)
*/
private $utilisateur;
/**
* @ORM\Column(name="libelle", type="string", length=255, nullable=true)
* @Assert\NotBlank(message="Libellé obligatoire")
*/
private $libelle;
/**
* @ORM\Column(name="date", type="datetime", nullable=true)
*/
private $date;
/**
* @ORM\Column(name="dateSuppression", type="datetime", nullable=true)
*/
private $dateSuppression;
/**
* @ORM\Column(name="dateMaj", type="datetime", nullable=true)
* @Gedmo\Timestampable(on="update")
*/
private $dateMaj;
/**
* @ORM\OneToMany(targetEntity="App\Entity\GestionComerciale\BordereauLCR",mappedBy="modeEncaissement")
*/
private $bordereauxLCR;
/**
* @ORM\OneToMany(targetEntity="App\Entity\GestionComerciale\Bordereau",mappedBy="modeEncaissement")
*/
private $bordereaux;
public function __construct()
{
$this->date = new Datetime();
$this->bordereauxLCR = new ArrayCollection();
}
public function getId(): int
{
return $this->id;
}
public function setLibelle(?string $libelle): ModeEncaissement
{
$this->libelle = $libelle;
return $this;
}
public function getLibelle(): ?string
{
return $this->libelle;
}
public function setDate(?DateTime $date): ModeEncaissement
{
$this->date = $date;
return $this;
}
public function getDate(): ?DateTime
{
return $this->date;
}
public function setDateSuppression(?DateTime $dateSuppression): ModeEncaissement
{
$this->dateSuppression = $dateSuppression;
return $this;
}
public function getDateSuppression(): ?DateTime
{
return $this->dateSuppression;
}
public function setDateMaj(?DateTime $dateMaj): ModeEncaissement
{
$this->dateMaj = $dateMaj;
return $this;
}
public function getDateMaj(): ?DateTime
{
return $this->dateMaj;
}
public function setUtilisateur(?Utilisateur $utilisateur): ModeEncaissement
{
$this->utilisateur = $utilisateur;
return $this;
}
public function getUtilisateur(): ?Utilisateur
{
return $this->utilisateur;
}
public function __toString() {
return $this->libelle;
}
public function addBordereauxLCR(BordereauLCR $bordereauxLCR): ModeEncaissement
{
$this->bordereauxLCR[] = $bordereauxLCR;
return $this;
}
public function removeBordereauxLCR(BordereauLCR $bordereauxLCR)
{
$this->bordereauxLCR->removeElement($bordereauxLCR);
}
public function getBordereauxLCR(): Collection
{
return $this->bordereauxLCR;
}
}