src/Entity/Dossier.php line 14

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