src/Entity/GestionComerciale/NumerotationDocument.php line 19

Open in your IDE?
  1. <?php
  2. namespace App\Entity\GestionComerciale;
  3. use App\Entity\Utilisateur\Utilisateur;
  4. use DateTime;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Gedmo\Mapping\Annotation as Gedmo;
  7. use Symfony\Component\Validator\Constraints as Assert;
  8. use App\Annotations\SecuredEntity;
  9. /**
  10.  * NumerotationDocument
  11.  *
  12.  * @ORM\Table("commerciale__numerotation_document")
  13.  * @ORM\Entity(repositoryClass="App\Repository\GestionComerciale\NumerotationDocumentRepository")
  14.  * @SecuredEntity(name="Numérotation document", group="REGLAGES")
  15.  */
  16. class NumerotationDocument
  17. {
  18.     /**
  19.      * @ORM\Column(name="id", type="integer")
  20.      * @ORM\Id
  21.      * @ORM\GeneratedValue(strategy="AUTO")
  22.      */
  23.     private $id;
  24.     /**
  25.      * @ORM\ManyToOne(targetEntity="App\Entity\Utilisateur\Utilisateur", inversedBy="numerotationDocument")
  26.      * @ORM\JoinColumn(nullable=true)
  27.      */
  28.     private $utilisateur;
  29.     /**
  30.      * @ORM\Column(name="document_commercial_id", type="integer", nullable=true)
  31.      */
  32.     private $documentCommercial;
  33.     /**
  34.      * @ORM\ManyToOne(targetEntity="App\Entity\GestionComerciale\ModeReglement")
  35.      * @ORM\JoinColumn(nullable=true)
  36.      */
  37.     private $modeReglement;
  38.     /**
  39.      * @ORM\Column(name="libelle", type="string", length=255, nullable=true)
  40.      */
  41.     private $libelle;
  42.     /**
  43.      * @ORM\Column(name="masque", type="string", length=255, nullable=true)
  44.      */
  45.     private $masque;
  46.     /**
  47.      * @ORM\Column(name="date", type="datetime", nullable=true)
  48.      */
  49.     private $date;
  50.     /**
  51.      * @ORM\Column(name="date_maj", type="datetime", nullable=true)
  52.      * @Gedmo\Timestampable(on="update")
  53.      */
  54.     private $dateMaj;
  55.     /**
  56.      * @ORM\Column(name="date_suppression", type="datetime", nullable=true)
  57.      */
  58.     private $dateSuppression;
  59.     public function __construct()
  60.     {
  61.         $this->date = new Datetime();
  62.     }
  63.     public function isMasqueValid(): bool
  64.     {
  65.         $pos strpos($this->masque,' ');
  66.         if ($pos === false) return true;
  67.         return false;
  68.     }
  69.     public function getId(): int
  70.     {
  71.         return $this->id;
  72.     }
  73.     public function setLibelle(?string $libelle): NumerotationDocument
  74.     {
  75.         $this->libelle $libelle;
  76.         return $this;
  77.     }
  78.     public function getLibelle(): ?string
  79.     {
  80.         return $this->libelle;
  81.     }
  82.     public function setDate(?DateTime $date): NumerotationDocument
  83.     {
  84.         $this->date $date;
  85.         return $this;
  86.     }
  87.     public function getDate(): ?DateTime
  88.     {
  89.         return $this->date;
  90.     }
  91.     public function setDateMaj(?DateTime $dateMaj): NumerotationDocument
  92.     {
  93.         $this->dateMaj $dateMaj;
  94.         return $this;
  95.     }
  96.     public function getDateMaj(): ?DateTime
  97.     {
  98.         return $this->dateMaj;
  99.     }
  100.     public function setDateSuppression(?DateTime $dateSuppression): NumerotationDocument
  101.     {
  102.         $this->dateSuppression $dateSuppression;
  103.         return $this;
  104.     }
  105.     public function getDateSuppression(): ?DateTime
  106.     {
  107.         return $this->dateSuppression;
  108.     }
  109.     public function setUtilisateur(?Utilisateur $utilisateur): NumerotationDocument
  110.     {
  111.         $this->utilisateur $utilisateur;
  112.         return $this;
  113.     }
  114.     public function getUtilisateur(): ?Utilisateur
  115.     {
  116.         return $this->utilisateur;
  117.     }
  118.     public function setMasque(?string $masque): NumerotationDocument
  119.     {
  120.         $this->masque $masque;
  121.         return $this;
  122.     }
  123.     public function getMasque(): ?string
  124.     {
  125.         return $this->masque;
  126.     }
  127.     public function setModeReglement(?ModeReglement $modeReglement): NumerotationDocument
  128.     {
  129.         $this->modeReglement $modeReglement;
  130.         return $this;
  131.     }
  132.     public function getModeReglement(): ?ModeReglement
  133.     {
  134.         return $this->modeReglement;
  135.     }
  136.     public function getDocumentCommercial(): ?int
  137.     {
  138.         return $this->documentCommercial;
  139.     }
  140.     public function setDocumentCommercial(?int $documentCommercial): self
  141.     {
  142.         $this->documentCommercial $documentCommercial;
  143.         return $this;
  144.     }
  145. }