src/Entity/TypeDocument.php line 11

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. #[ORM\Entity(repositoryClassTypeDocumentRepository::class)]
  8. class TypeDocument implements \Stringable
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column(type'integer')]
  13.     private int $id;
  14.     #[ORM\Column(type'string'length255nullabletrue)]
  15.     private ?string $titrenull;
  16.     #[ORM\ManyToMany(targetEntityDocument::class, mappedBy'types')]
  17.     private mixed $documents;
  18.     #[ORM\Column(type'string'length255nullabletrue)]
  19.     private ?string $name_gednull;
  20.     public function __construct()
  21.     {
  22.         $this->documents = new ArrayCollection();
  23.     }
  24.     public function __toString(): string
  25.     {
  26.         return (string) $this->titre;
  27.     }
  28.     public function getId(): ?int
  29.     {
  30.         return $this->id;
  31.     }
  32.     public function getTitre(): ?string
  33.     {
  34.         return $this->titre;
  35.     }
  36.     public function setTitre(?string $titre): self
  37.     {
  38.         $this->titre $titre;
  39.         return $this;
  40.     }
  41.     /**
  42.      * @return Collection|Document[]
  43.      */
  44.     public function getDocuments(): Collection
  45.     {
  46.         return $this->documents;
  47.     }
  48.     public function addDocument(Document $document): self
  49.     {
  50.         if (!$this->documents->contains($document)) {
  51.             $this->documents[] = $document;
  52.             $document->addType($this);
  53.         }
  54.         return $this;
  55.     }
  56.     public function removeDocument(Document $document): self
  57.     {
  58.         if ($this->documents->removeElement($document)) {
  59.             $document->removeType($this);
  60.         }
  61.         return $this;
  62.     }
  63.     public function getNameGed(): ?string
  64.     {
  65.         return $this->name_ged;
  66.     }
  67.     public function setNameGed(?string $name_ged): self
  68.     {
  69.         $this->name_ged $name_ged;
  70.         return $this;
  71.     }
  72. }