<?php
namespace App\Entity\Clients;
use App\Entity\Utilisateur\Utilisateur;
use DateTime;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Symfony\Component\Validator\Constraints as Assert;
/**
* Type
*
* @ORM\Table("client__type")
* @ORM\Entity(repositoryClass="App\Repository\Clients\TypeRepository")
* @Gedmo\SoftDeleteable(fieldName="dateSuppression",timeAware=false)
*/
class Type
{
/**
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Clients\Client", cascade={"persist"},mappedBy="typeClient")
*/
private $clients;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Utilisateur\Utilisateur", inversedBy="typeClient")
* @ORM\JoinColumn(nullable=true)
*/
private $utilisateur;
/**
* @ORM\Column(name="libelle", type="string", length=255)
* @Assert\NotBlank(message="Libellé obligatoire")
*/
private $libelle;
/**
* @ORM\Column(name="avecTaxe", type="boolean", nullable=true)
*/
private $avecTaxe;
/**
* @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;
public function __construct()
{
$this->date = new Datetime();
}
public function getId(): int
{
return $this->id;
}
public function setLibelle(string $libelle): Type
{
$this->libelle = $libelle;
return $this;
}
public function getLibelle(): string
{
return $this->libelle;
}
public function setDate(?DateTime $date): Type
{
$this->date = $date;
return $this;
}
public function getDate(): ?DateTime
{
return $this->date;
}
public function setDateSuppression(?DateTime $dateSuppression): Type
{
$this->dateSuppression = $dateSuppression;
return $this;
}
public function getDateSuppression(): ?DateTime
{
return $this->dateSuppression;
}
public function setDateMaj(?DateTime $dateMaj): Type
{
$this->dateMaj = $dateMaj;
return $this;
}
public function getDateMaj(): ?DateTime
{
return $this->dateMaj;
}
public function setUtilisateur(?Utilisateur $utilisateur): Type
{
$this->utilisateur = $utilisateur;
return $this;
}
public function getUtilisateur(): ?Utilisateur
{
return $this->utilisateur;
}
public function addClient(Client $clients): Type
{
$this->clients[] = $clients;
return $this;
}
public function removeClient(Client $clients)
{
$this->clients->removeElement($clients);
}
public function getClients(): Collection
{
return $this->clients;
}
public function __toString()
{
return $this->libelle;
}
public function setAvecTaxe(?bool $avecTaxe): Type
{
$this->avecTaxe = $avecTaxe;
return $this;
}
public function getAvecTaxe(): ?bool
{
return $this->avecTaxe;
}
}