src/Entity/Clients/Type.php line 19

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Clients;
  3. use App\Entity\Utilisateur\Utilisateur;
  4. use DateTime;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Gedmo\Mapping\Annotation as Gedmo;
  8. use Symfony\Component\Validator\Constraints as Assert;
  9. /**
  10.  * Type
  11.  *
  12.  * @ORM\Table("client__type")
  13.  * @ORM\Entity(repositoryClass="App\Repository\Clients\TypeRepository")
  14.  * @Gedmo\SoftDeleteable(fieldName="dateSuppression",timeAware=false)
  15.  */
  16. class Type
  17. {
  18.     /**
  19.      * @ORM\Column(name="id", type="integer")
  20.      * @ORM\Id
  21.      * @ORM\GeneratedValue(strategy="AUTO")
  22.      */
  23.     private $id;
  24.     /**
  25.      * @ORM\OneToMany(targetEntity="App\Entity\Clients\Client", cascade={"persist"},mappedBy="typeClient")
  26.      */
  27.     private $clients;
  28.     /**
  29.      * @ORM\ManyToOne(targetEntity="App\Entity\Utilisateur\Utilisateur", inversedBy="typeClient")
  30.      * @ORM\JoinColumn(nullable=true)
  31.      */
  32.     private $utilisateur;
  33.     /**
  34.      * @ORM\Column(name="libelle", type="string", length=255)
  35.      * @Assert\NotBlank(message="LibellĂ© obligatoire")
  36.      */
  37.     private $libelle;
  38.     
  39.     /**
  40.      * @ORM\Column(name="avecTaxe", type="boolean", nullable=true)
  41.      */
  42.     private $avecTaxe;
  43.     /**
  44.      * @ORM\Column(name="date", type="datetime", nullable=true)
  45.      */
  46.     private $date;
  47.     /**
  48.      * @ORM\Column(name="dateSuppression", type="datetime", nullable=true)
  49.      */
  50.     private $dateSuppression;
  51.     /**
  52.      * @ORM\Column(name="dateMaj", type="datetime", nullable=true)
  53.      * @Gedmo\Timestampable(on="update")
  54.      */
  55.     private $dateMaj;
  56.     public function __construct()
  57.     {
  58.         $this->date = new Datetime();
  59.     }
  60.     public function getId(): int
  61.     {
  62.         return $this->id;
  63.     }
  64.     public function setLibelle(string $libelle): Type
  65.     {
  66.         $this->libelle $libelle;
  67.         return $this;
  68.     }
  69.     public function getLibelle(): string
  70.     {
  71.         return $this->libelle;
  72.     }
  73.     public function setDate(?DateTime $date): Type
  74.     {
  75.         $this->date $date;
  76.         return $this;
  77.     }
  78.     public function getDate(): ?DateTime
  79.     {
  80.         return $this->date;
  81.     }
  82.     public function setDateSuppression(?DateTime $dateSuppression): Type
  83.     {
  84.         $this->dateSuppression $dateSuppression;
  85.         return $this;
  86.     }
  87.     public function getDateSuppression(): ?DateTime
  88.     {
  89.         return $this->dateSuppression;
  90.     }
  91.     public function setDateMaj(?DateTime $dateMaj): Type
  92.     {
  93.         $this->dateMaj $dateMaj;
  94.         return $this;
  95.     }
  96.     public function getDateMaj(): ?DateTime
  97.     {
  98.         return $this->dateMaj;
  99.     }
  100.     public function setUtilisateur(?Utilisateur $utilisateur): Type
  101.     {
  102.         $this->utilisateur $utilisateur;
  103.         return $this;
  104.     }
  105.     public function getUtilisateur(): ?Utilisateur
  106.     {
  107.         return $this->utilisateur;
  108.     }
  109.     public function addClient(Client $clients): Type
  110.     {
  111.         $this->clients[] = $clients;
  112.         return $this;
  113.     }
  114.     public function removeClient(Client $clients)
  115.     {
  116.         $this->clients->removeElement($clients);
  117.     }
  118.     public function getClients(): Collection
  119.     {
  120.         return $this->clients;
  121.     }
  122.     
  123.     public function __toString()
  124.     {
  125.         return $this->libelle;
  126.     }
  127.     public function setAvecTaxe(?bool $avecTaxe): Type
  128.     {
  129.         $this->avecTaxe $avecTaxe;
  130.         return $this;
  131.     }
  132.     public function getAvecTaxe(): ?bool
  133.     {
  134.         return $this->avecTaxe;
  135.     }
  136. }