<?php
namespace App\Entity;
use App\Repository\DossierRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: DossierRepository::class)]
class Dossier
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $label = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE)]
private ?\DateTimeInterface $date_creation = null;
#[ORM\Column]
private ?bool $actif = null;
#[ORM\Column]
private ?bool $biblio = null;
#[ORM\ManyToOne(inversedBy: 'dossiers')]
private ?DossierDocType $dossier_type = null;
#[ORM\ManyToOne(inversedBy: 'dossiers')]
private ?Project $projet = null;
#[ORM\ManyToOne(inversedBy: 'dossiers')]
private ?Contact $contact = null;
#[ORM\OneToMany(mappedBy: 'dossier', targetEntity: Document::class, cascade: ['remove'])]
private Collection $documents;
#[ORM\ManyToOne(inversedBy: 'dossiers')]
private ?User $utilisateur = null;
public function __construct()
{
$this->documents = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getLabel(): ?string
{
return $this->label;
}
public function setLabel(string $label): static
{
$this->label = $label;
return $this;
}
public function getDateCreation(): ?\DateTimeInterface
{
return $this->date_creation;
}
public function setDateCreation(\DateTimeInterface $date_creation): static
{
$this->date_creation = $date_creation;
return $this;
}
public function isActif(): ?bool
{
return $this->actif;
}
public function setActif(bool $actif): static
{
$this->actif = $actif;
return $this;
}
public function isBiblio(): ?bool
{
return $this->biblio;
}
public function setBiblio(bool $biblio): static
{
$this->biblio = $biblio;
return $this;
}
public function getDossierType(): ?DossierDocType
{
return $this->dossier_type;
}
public function setDossierType(?DossierDocType $dossier_type): static
{
$this->dossier_type = $dossier_type;
return $this;
}
public function getProjet(): ?Project
{
return $this->projet;
}
public function setProjet(?Project $projet): static
{
$this->projet = $projet;
return $this;
}
public function getContact(): ?Contact
{
return $this->contact;
}
public function setContact(?Contact $contact): static
{
$this->contact = $contact;
return $this;
}
/**
* @return Collection<int, Document>
*/
public function getDocuments(): Collection
{
return $this->documents;
}
public function addDocument(Document $document): static
{
if (!$this->documents->contains($document)) {
$this->documents->add($document);
$document->setDossier($this);
}
return $this;
}
public function removeDocument(Document $document): static
{
if ($this->documents->removeElement($document)) {
// set the owning side to null (unless already changed)
if ($document->getDossier() === $this) {
$document->setDossier(null);
}
}
return $this;
}
public function getUtilisateur(): ?User
{
return $this->utilisateur;
}
public function setUtilisateur(?User $utilisateur): static
{
$this->utilisateur = $utilisateur;
return $this;
}
}