<?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
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $libelle;
/**
* @ORM\OneToMany(targetEntity=FormationDocument::class, mappedBy="typeDocument")
*/
private $formationDocuments;
public function __toString()
{
return $this->libelle;
}
public function __construct()
{
$this->formationDocuments = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getLibelle(): ?string
{
return $this->libelle;
}
public function setLibelle(string $libelle): self
{
$this->libelle = $libelle;
return $this;
}
/**
* @return Collection<int, FormationDocument>
*/
public function getFormationDocuments(): Collection
{
return $this->formationDocuments;
}
public function addFormationDocument(FormationDocument $formationDocument): self
{
if (!$this->formationDocuments->contains($formationDocument)) {
$this->formationDocuments[] = $formationDocument;
$formationDocument->setTypeDocument($this);
}
return $this;
}
public function removeFormationDocument(FormationDocument $formationDocument): self
{
if ($this->formationDocuments->removeElement($formationDocument)) {
// set the owning side to null (unless already changed)
if ($formationDocument->getTypeDocument() === $this) {
$formationDocument->setTypeDocument(null);
}
}
return $this;
}
}