src/Entity/Vetoadom/Document.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Vetoadom;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5.  * Document
  6.  *
  7.  * @ORM\Table(name="document", indexes={@ORM\Index(name="FK_document_secteur_zone_id", columns={"secteur_zone_id"}), @ORM\Index(name="FK_document_document_type_id", columns={"document_type_id"})})
  8.  * @ORM\Entity(repositoryClass="App\Repository\Vetoadom\DocumentRepository")
  9.  * @ORM\HasLifecycleCallbacks()
  10.  */
  11. class Document
  12. {
  13.     /**
  14.      * @var int
  15.      *
  16.      * @ORM\Column(name="id", type="integer", nullable=false)
  17.      * @ORM\Id
  18.      * @ORM\GeneratedValue(strategy="IDENTITY")
  19.      */
  20.     private $id;
  21.     /**
  22.      * @var string
  23.      *
  24.      * @ORM\Column(name="nom", type="string", length=500, nullable=false)
  25.      */
  26.     private $nom;
  27.     /**
  28.      * @var bool
  29.      *
  30.      * @ORM\Column(name="active", type="boolean", nullable=false, options={"default"="1"})
  31.      */
  32.     private $active true;
  33.     /**
  34.      * @var \DateTime
  35.      *
  36.      * @ORM\Column(name="date_creation", type="datetime", nullable=false)
  37.      */
  38.     private $dateCreation;
  39.     /**
  40.      * @var \DateTime
  41.      *
  42.      * @ORM\Column(name="date_modification", type="datetime", nullable=false, options={"default"="CURRENT_TIMESTAMP"})
  43.      */
  44.     private $dateModification;
  45.     /**
  46.      * @var \Referant
  47.      *
  48.      * @ORM\ManyToOne(targetEntity="Referant", inversedBy="documents")
  49.      * @ORM\JoinColumns({
  50.      *   @ORM\JoinColumn(name="referant_id", referencedColumnName="id")
  51.      * })
  52.      */
  53.     private $referant;
  54.     /**
  55.      * @var \SecteurZone
  56.      *
  57.      * @ORM\ManyToOne(targetEntity="SecteurZone", inversedBy="documents")
  58.      * @ORM\JoinColumns({
  59.      *   @ORM\JoinColumn(name="secteur_zone_id", referencedColumnName="id")
  60.      * })
  61.      */
  62.     private $secteurZone;
  63.     /**
  64.      * @var \DocumentType
  65.      *
  66.      * @ORM\ManyToOne(targetEntity="DocumentType")
  67.      * @ORM\JoinColumns({
  68.      *   @ORM\JoinColumn(name="document_type_id", referencedColumnName="id")
  69.      * })
  70.      */
  71.     private $documentType;
  72.     public function getId(): ?int
  73.     {
  74.         return $this->id;
  75.     }
  76.     public function getNom(): ?string
  77.     {
  78.         return $this->nom;
  79.     }
  80.     public function setNom(string $nom): self
  81.     {
  82.         $this->nom $nom;
  83.         return $this;
  84.     }
  85.     public function getActive(): ?bool
  86.     {
  87.         return $this->active;
  88.     }
  89.     public function setActive(bool $active): self
  90.     {
  91.         $this->active $active;
  92.         return $this;
  93.     }
  94.     public function getDateCreation(): ?\DateTimeInterface
  95.     {
  96.         return $this->dateCreation;
  97.     }
  98.     public function setDateCreation(\DateTimeInterface $dateCreation): self
  99.     {
  100.         $this->dateCreation $dateCreation;
  101.         return $this;
  102.     }
  103.     public function getDateModification(): ?\DateTimeInterface
  104.     {
  105.         return $this->dateModification;
  106.     }
  107.     public function setDateModification(\DateTimeInterface $dateModification): self
  108.     {
  109.         $this->dateModification $dateModification;
  110.         return $this;
  111.     }
  112.     public function getReferant(): ?Referant
  113.     {
  114.         return $this->referant;
  115.     }
  116.     public function setReferant(?Referant $referant): self
  117.     {
  118.         $this->referant $referant;
  119.         return $this;
  120.     }
  121.     public function getSecteurZone(): ?SecteurZone
  122.     {
  123.         return $this->secteurZone;
  124.     }
  125.     public function setSecteurZone(?SecteurZone $secteurZone): self
  126.     {
  127.         $this->secteurZone $secteurZone;
  128.         return $this;
  129.     }
  130.     public function getDocumentType(): ?DocumentType
  131.     {
  132.         return $this->documentType;
  133.     }
  134.     public function setDocumentType(?DocumentType $documentType): self
  135.     {
  136.         $this->documentType $documentType;
  137.         return $this;
  138.     }
  139.     /**
  140.      * @ORM\PrePersist
  141.      */
  142.     public function setCreatedAtValue()
  143.     {
  144.         $this->dateCreation = new \DateTimeImmutable();
  145.     }
  146. }