src/Entity/Exercice.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ExerciceRepository;
  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(repositoryClassExerciceRepository::class)]
  9. class Exercice
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id null;
  15.     #[ORM\Column(length100)]
  16.     private ?string $libelle null;
  17.     #[ORM\Column(typeTypes::DATE_MUTABLE)]
  18.     private ?\DateTimeInterface $dateDebut null;
  19.     #[ORM\Column(typeTypes::DATE_MUTABLE)]
  20.     private ?\DateTimeInterface $dateFin null;
  21.     #[ORM\Column]
  22.     private ?bool $estCloture false;
  23.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  24.     private ?\DateTimeInterface $dateCloture null;
  25.     #[ORM\OneToMany(mappedBy'exercice'targetEntityEcritureComptable::class)]
  26.     private Collection $ecrituresComptables;
  27.     #[ORM\ManyToOne(inversedBy'exercices')]
  28.     private ?Boutique $boutique null;
  29.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  30.     private ?string $notes null;
  31.     public function __construct()
  32.     {
  33.         $this->ecrituresComptables = new ArrayCollection();
  34.     }
  35.     public function getId(): ?int
  36.     {
  37.         return $this->id;
  38.     }
  39.     public function getLibelle(): ?string
  40.     {
  41.         return $this->libelle;
  42.     }
  43.     public function setLibelle(string $libelle): static
  44.     {
  45.         $this->libelle $libelle;
  46.         return $this;
  47.     }
  48.     public function getDateDebut(): ?\DateTimeInterface
  49.     {
  50.         return $this->dateDebut;
  51.     }
  52.     public function setDateDebut(\DateTimeInterface $dateDebut): static
  53.     {
  54.         $this->dateDebut $dateDebut;
  55.         return $this;
  56.     }
  57.     public function getDateFin(): ?\DateTimeInterface
  58.     {
  59.         return $this->dateFin;
  60.     }
  61.     public function setDateFin(\DateTimeInterface $dateFin): static
  62.     {
  63.         $this->dateFin $dateFin;
  64.         return $this;
  65.     }
  66.     public function isEstCloture(): ?bool
  67.     {
  68.         return $this->estCloture;
  69.     }
  70.     public function setEstCloture(bool $estCloture): static
  71.     {
  72.         $this->estCloture $estCloture;
  73.         return $this;
  74.     }
  75.     public function getDateCloture(): ?\DateTimeInterface
  76.     {
  77.         return $this->dateCloture;
  78.     }
  79.     public function setDateCloture(?\DateTimeInterface $dateCloture): static
  80.     {
  81.         $this->dateCloture $dateCloture;
  82.         return $this;
  83.     }
  84.     /**
  85.      * @return Collection<int, EcritureComptable>
  86.      */
  87.     public function getEcrituresComptables(): Collection
  88.     {
  89.         return $this->ecrituresComptables;
  90.     }
  91.     public function addEcritureComptable(EcritureComptable $ecritureComptable): static
  92.     {
  93.         if (!$this->ecrituresComptables->contains($ecritureComptable)) {
  94.             $this->ecrituresComptables->add($ecritureComptable);
  95.             $ecritureComptable->setExercice($this);
  96.         }
  97.         return $this;
  98.     }
  99.     public function removeEcritureComptable(EcritureComptable $ecritureComptable): static
  100.     {
  101.         if ($this->ecrituresComptables->removeElement($ecritureComptable)) {
  102.             if ($ecritureComptable->getExercice() === $this) {
  103.                 $ecritureComptable->setExercice(null);
  104.             }
  105.         }
  106.         return $this;
  107.     }
  108.     public function getBoutique(): ?Boutique
  109.     {
  110.         return $this->boutique;
  111.     }
  112.     public function setBoutique(?Boutique $boutique): static
  113.     {
  114.         $this->boutique $boutique;
  115.         return $this;
  116.     }
  117.     public function getNotes(): ?string
  118.     {
  119.         return $this->notes;
  120.     }
  121.     public function setNotes(?string $notes): static
  122.     {
  123.         $this->notes $notes;
  124.         return $this;
  125.     }
  126.     public function __toString(): string
  127.     {
  128.         return $this->libelle ?? '';
  129.     }
  130. }