src/Entity/Dossier.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\DossierRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. #[ORM\Entity(repositoryClassDossierRepository::class)]
  9. class Dossier
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id null;
  15.     #[ORM\Column(length255)]
  16.     private ?string $label null;
  17.     #[ORM\Column(typeTypes::DATETIME_MUTABLE)]
  18.     private ?\DateTimeInterface $date_creation null;
  19.     #[ORM\Column]
  20.     private ?bool $actif null;
  21.     #[ORM\Column]
  22.     private ?bool $biblio null;
  23.     #[ORM\Column(typeTypes::INTEGERoptions: ['default' => 1])]
  24.     private int $etat 1;
  25.     #[ORM\ManyToOne(inversedBy'dossiers')]
  26.     #[ORM\JoinColumn(onDelete"CASCADE")]
  27.     private ?Objet $objet null;
  28.     #[ORM\ManyToOne(inversedBy'dossiers')]
  29.     private ?Contact $contact null;
  30.     #[ORM\OneToMany(mappedBy'dossier'targetEntityDocument::class, cascade: ['remove'])]
  31.     private Collection $documents;
  32.     #[ORM\ManyToOne(inversedBy'dossiers')]
  33.     private ?User $utilisateur null;
  34.     public function __construct()
  35.     {
  36.         $this->documents = new ArrayCollection();
  37.     }
  38.     public function getId(): ?int
  39.     {
  40.         return $this->id;
  41.     }
  42.     public function getLabel(): ?string
  43.     {
  44.         return $this->label;
  45.     }
  46.     public function setLabel(string $label): static
  47.     {
  48.         $this->label $label;
  49.         return $this;
  50.     }
  51.     public function getDateCreation(): ?\DateTimeInterface
  52.     {
  53.         return $this->date_creation;
  54.     }
  55.     public function setDateCreation(\DateTimeInterface $date_creation): static
  56.     {
  57.         $this->date_creation $date_creation;
  58.         return $this;
  59.     }
  60.     public function isActif(): ?bool
  61.     {
  62.         return $this->actif;
  63.     }
  64.     public function setActif(bool $actif): static
  65.     {
  66.         $this->actif $actif;
  67.         return $this;
  68.     }
  69.     public function isBiblio(): ?bool
  70.     {
  71.         return $this->biblio;
  72.     }
  73.     public function setBiblio(bool $biblio): static
  74.     {
  75.         $this->biblio $biblio;
  76.         return $this;
  77.     }
  78.     public function getObjet(): ?Objet
  79.     {
  80.         return $this->objet;
  81.     }
  82.     public function setObjet(?Objet $objet): static
  83.     {
  84.         $this->objet $objet;
  85.         return $this;
  86.     }
  87.     public function getContact(): ?Contact
  88.     {
  89.         return $this->contact;
  90.     }
  91.     public function setContact(?Contact $contact): static
  92.     {
  93.         $this->contact $contact;
  94.         return $this;
  95.     }
  96.     /**
  97.      * @return Collection<int, Document>
  98.      */
  99.     public function getDocuments(): Collection
  100.     {
  101.         return $this->documents;
  102.     }
  103.     public function addDocument(Document $document): static
  104.     {
  105.         if (!$this->documents->contains($document)) {
  106.             $this->documents->add($document);
  107.             $document->setDossier($this);
  108.         }
  109.         return $this;
  110.     }
  111.     public function removeDocument(Document $document): static
  112.     {
  113.         if ($this->documents->removeElement($document)) {
  114.             // set the owning side to null (unless already changed)
  115.             if ($document->getDossier() === $this) {
  116.                 $document->setDossier(null);
  117.             }
  118.         }
  119.         return $this;
  120.     }
  121.     public function getUtilisateur(): ?User
  122.     {
  123.         return $this->utilisateur;
  124.     }
  125.     public function setUtilisateur(?User $utilisateur): static
  126.     {
  127.         $this->utilisateur $utilisateur;
  128.         return $this;
  129.     }
  130.     public function getEtat(): int
  131.     {
  132.         return $this->etat;
  133.     }
  134.     public function setEtat(int $etat): static
  135.     {
  136.         $this->etat $etat;
  137.         return $this;
  138.     }
  139. }