src/Entity/Document.php line 10

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5.  * @ORM\Entity(repositoryClass="App\Repository\DocumentRepository")
  6.  */
  7. class Document
  8. {
  9.     /**
  10.      * @ORM\Id()
  11.      * @ORM\GeneratedValue()
  12.      * @ORM\Column(type="integer")
  13.      */
  14.     private $id;
  15.     /**
  16.      * @ORM\Column(type="string")
  17.      */
  18.     private $reference;
  19.     /**
  20.      * @ORM\Column(type="string", nullable = true, length=255)
  21.      */
  22.     private $libelle;
  23.     /**
  24.      * @ORM\Column(type="string", nullable=true)
  25.      */
  26.     private $version;
  27.     /**
  28.      * @ORM\Column(type="string", nullable = true, length=255)
  29.      */
  30.     private $niveau;
  31.     /**
  32.      * @ORM\ManyToOne(targetEntity="App\Entity\User", inversedBy="documents")
  33.      */
  34.     private $redacteur;
  35.     /**
  36.      * @ORM\ManyToOne(targetEntity="App\Entity\User", inversedBy="documentApprouves")
  37.      */
  38.      private $approuverPar;
  39.     /**
  40.      * @ORM\Column(type="string", nullable = true, length=255)
  41.      */
  42.     private $service;
  43.     /**
  44.      * @ORM\Column(type="string", nullable = true, length=255)
  45.      */
  46.     private $status;
  47.     /**
  48.      * @ORM\Column(type="string", nullable = true, length=255)
  49.      */
  50.     private $brochureFilename;
  51.     /**
  52.      * @ORM\Column(type="datetime")
  53.      */
  54.     private $createdAt;
  55.     public  function __construct(){
  56.         $this->createdAt = new \DateTime('now');
  57.         if (!isset($this->reference)){
  58.             $this->reference 'DOC'.random_int(1,99).date('s');
  59.         }else{
  60.             $this->reference 'DOC'.random_int(1,99).date('s');
  61.         }
  62.     }
  63.     /**
  64.      * @return mixed
  65.      */
  66.     public function getCreatedAt()
  67.     {
  68.         return $this->createdAt;
  69.     }
  70.     /**
  71.      * @param mixed $createdAt
  72.      * @return Abonne
  73.      */
  74.     public function setCreatedAt($createdAt)
  75.     {
  76.         $this->createdAt $createdAt;
  77.         return $this;
  78.     }
  79.     public function getBrochureFilename(): ?string
  80.     {
  81.         return $this->brochureFilename;
  82.     }
  83.     public function setBrochureFilename(?string $brochureFilename): self
  84.     {
  85.         $this->brochureFilename $brochureFilename;
  86.         return $this;
  87.     }
  88.     /**
  89.      * @return mixed
  90.      */
  91.     public function getId(): ?int
  92.     {
  93.         return $this->id;
  94.     }
  95.     /**
  96.      * @return mixed
  97.      */
  98.     public function getReference(): string
  99.     {
  100.         return $this->reference;
  101.     }
  102.     /**
  103.      * @param mixed $reference
  104.      * @return Document
  105.      */
  106.     public function setReference(?string $reference): self
  107.     {
  108.         $this->reference $reference;
  109.         return $this;
  110.     }
  111.     /**
  112.      * @return mixed
  113.      */
  114.     public function getService(): ?string
  115.     {
  116.         return $this->service;
  117.     }
  118.     /**
  119.      * @param mixed $service
  120.      * @return Document
  121.      */
  122.     public function setService(?string $service): self
  123.     {
  124.         $this->service $service;
  125.         return $this;
  126.     }
  127.     /**
  128.      * @return mixed
  129.      */
  130.     public function getRedacteur(): ?User
  131.     {
  132.         return $this->redacteur;
  133.     }
  134.     /**
  135.      * @param mixed $redacteur
  136.      * @return Document
  137.      */
  138.     public function setRedacteur(?User $redacteur): self
  139.     {
  140.         $this->redacteur $redacteur;
  141.         return $this;
  142.     }
  143.     /**
  144.      * @return mixed
  145.      */
  146.     public function getApprouverPar(): ?User
  147.     {
  148.         return $this->approuverPar;
  149.     }
  150.     /**
  151.      * @param mixed $approuverPar
  152.      * @return Document
  153.      */
  154.     public function setApprouverPar(?User $approuverPar): self
  155.     {
  156.         $this->approuverPar $approuverPar;
  157.         return $this;
  158.     }
  159.     /**
  160.      * @return mixed
  161.      */
  162.     public function getStatus(): ?string
  163.     {
  164.         return $this->status;
  165.     }
  166.     /**
  167.      * @param mixed $status
  168.      * @return Document
  169.      */
  170.     public function setStatus(?string $status): self
  171.     {
  172.         $this->status $status;
  173.         return $this;
  174.     }
  175.     /**
  176.      * @return mixed
  177.      */
  178.     public function getLibelle(): ?string
  179.     {
  180.         return $this->libelle;
  181.     }
  182.     /**
  183.      * @param mixed $libelle
  184.      * @return Document
  185.      */
  186.     public function setLibelle(?string $libelle): self
  187.     {
  188.         $this->libelle $libelle;
  189.         return $this;
  190.     }
  191.     /**
  192.      * @return mixed
  193.      */
  194.     public function getVersion(): ?string
  195.     {
  196.         return $this->version;
  197.     }
  198.     /**
  199.      * @param mixed $version
  200.      * @return Document
  201.      */
  202.     public function setVersion(?string $version): self
  203.     {
  204.         $this->version $version;
  205.         return $this;
  206.     }
  207.     /**
  208.      * @return mixed
  209.      */
  210.     public function getNiveau(): ?string
  211.     {
  212.         return $this->niveau;
  213.     }
  214.     /**
  215.      * @param mixed $niveau
  216.      * @return Document
  217.      */
  218.     public function setNiveau(?string $niveau): self
  219.     {
  220.         $this->niveau $niveau;
  221.         return $this;
  222.     }
  223. }