<?php
namespace App\Entity;
use App\Repository\TypeDocumentRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: TypeDocumentRepository::class)]
class TypeDocument implements \Stringable
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private int $id;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $titre= null;
#[ORM\ManyToMany(targetEntity: Document::class, mappedBy: 'types')]
private mixed $documents;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $name_ged= null;
public function __construct()
{
$this->documents = new ArrayCollection();
}
public function __toString(): string
{
return (string) $this->titre;
}
public function getId(): ?int
{
return $this->id;
}
public function getTitre(): ?string
{
return $this->titre;
}
public function setTitre(?string $titre): self
{
$this->titre = $titre;
return $this;
}
/**
* @return Collection|Document[]
*/
public function getDocuments(): Collection
{
return $this->documents;
}
public function addDocument(Document $document): self
{
if (!$this->documents->contains($document)) {
$this->documents[] = $document;
$document->addType($this);
}
return $this;
}
public function removeDocument(Document $document): self
{
if ($this->documents->removeElement($document)) {
$document->removeType($this);
}
return $this;
}
public function getNameGed(): ?string
{
return $this->name_ged;
}
public function setNameGed(?string $name_ged): self
{
$this->name_ged = $name_ged;
return $this;
}
}