src/Entity/TypeDocument.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\TypeDocumentRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Gedmo\Mapping\Annotation as Gedmo;
  8. #[ORM\Entity(repositoryClassTypeDocumentRepository::class)]
  9. class TypeDocument
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column(type'integer')]
  14.     private $id;
  15.     #[ORM\Column(type'string'length255nullabletrue)]
  16.     private $code;
  17.     #[ORM\Column(type'string'length255)]
  18.     private $nom;
  19.     #[ORM\OneToMany(mappedBy'typedocument'targetEntityDocument::class)]
  20.     private $documents;
  21.     #[Gedmo\Timestampable(on'create')]
  22.     #[ORM\Column(type'datetime')]
  23.     private $created_at;
  24.     #[Gedmo\Timestampable(on'update')]
  25.     #[ORM\Column(type'datetime')]
  26.     private $updated_at;
  27.     #[ORM\Column(type'integer')]
  28.     private $created_by;
  29.     #[ORM\Column(type'integer')]
  30.     private $updated_by;
  31.     public function __construct()
  32.     {
  33.         $this->documents = new ArrayCollection();
  34.     }
  35.     public function getId(): ?int
  36.     {
  37.         return $this->id;
  38.     }
  39.     public function getCode(): ?string
  40.     {
  41.         return $this->code;
  42.     }
  43.     public function setCode(?string $code): self
  44.     {
  45.         $this->code $code;
  46.         return $this;
  47.     }
  48.     public function getNom(): ?string
  49.     {
  50.         return $this->nom;
  51.     }
  52.     public function setNom(string $nom): self
  53.     {
  54.         $this->nom $nom;
  55.         return $this;
  56.     }
  57.     /**
  58.      * @return Collection<int, Document>
  59.      */
  60.     public function getDocuments(): Collection
  61.     {
  62.         return $this->documents;
  63.     }
  64.     public function addDocument(Document $document): self
  65.     {
  66.         if (!$this->documents->contains($document)) {
  67.             $this->documents[] = $document;
  68.             $document->setTypedocument($this);
  69.         }
  70.         return $this;
  71.     }
  72.     public function removeDocument(Document $document): self
  73.     {
  74.         if ($this->documents->removeElement($document)) {
  75.             // set the owning side to null (unless already changed)
  76.             if ($document->getTypedocument() === $this) {
  77.                 $document->setTypedocument(null);
  78.             }
  79.         }
  80.         return $this;
  81.     }
  82.     public function getCreatedAt(): ?\DateTimeInterface
  83.     {
  84.         return $this->created_at;
  85.     }
  86.     public function setCreatedAt(\DateTimeInterface $created_at): self
  87.     {
  88.         $this->created_at $created_at;
  89.         return $this;
  90.     }
  91.     public function getUpdatedAt(): ?\DateTimeInterface
  92.     {
  93.         return $this->updated_at;
  94.     }
  95.     public function setUpdatedAt(\DateTimeInterface $updated_at): self
  96.     {
  97.         $this->updated_at $updated_at;
  98.         return $this;
  99.     }
  100.     public function getCreatedBy(): ?int
  101.     {
  102.         return $this->created_by;
  103.     }
  104.     public function setCreatedBy(int $created_by): self
  105.     {
  106.         $this->created_by $created_by;
  107.         return $this;
  108.     }
  109.     public function getUpdatedBy(): ?int
  110.     {
  111.         return $this->updated_by;
  112.     }
  113.     public function setUpdatedBy(int $updated_by): self
  114.     {
  115.         $this->updated_by $updated_by;
  116.         return $this;
  117.     }
  118. }