<?phpnamespace App\Entity;use App\Repository\ExerciceRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: ExerciceRepository::class)]class Exercice{ #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column] private ?int $id = null; #[ORM\Column(length: 100)] private ?string $libelle = null; #[ORM\Column(type: Types::DATE_MUTABLE)] private ?\DateTimeInterface $dateDebut = null; #[ORM\Column(type: Types::DATE_MUTABLE)] private ?\DateTimeInterface $dateFin = null; #[ORM\Column] private ?bool $estCloture = false; #[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)] private ?\DateTimeInterface $dateCloture = null; #[ORM\OneToMany(mappedBy: 'exercice', targetEntity: EcritureComptable::class)] private Collection $ecrituresComptables; #[ORM\ManyToOne(inversedBy: 'exercices')] private ?Boutique $boutique = null; #[ORM\Column(type: Types::TEXT, nullable: true)] private ?string $notes = null; public function __construct() { $this->ecrituresComptables = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getLibelle(): ?string { return $this->libelle; } public function setLibelle(string $libelle): static { $this->libelle = $libelle; return $this; } public function getDateDebut(): ?\DateTimeInterface { return $this->dateDebut; } public function setDateDebut(\DateTimeInterface $dateDebut): static { $this->dateDebut = $dateDebut; return $this; } public function getDateFin(): ?\DateTimeInterface { return $this->dateFin; } public function setDateFin(\DateTimeInterface $dateFin): static { $this->dateFin = $dateFin; return $this; } public function isEstCloture(): ?bool { return $this->estCloture; } public function setEstCloture(bool $estCloture): static { $this->estCloture = $estCloture; return $this; } public function getDateCloture(): ?\DateTimeInterface { return $this->dateCloture; } public function setDateCloture(?\DateTimeInterface $dateCloture): static { $this->dateCloture = $dateCloture; return $this; } /** * @return Collection<int, EcritureComptable> */ public function getEcrituresComptables(): Collection { return $this->ecrituresComptables; } public function addEcritureComptable(EcritureComptable $ecritureComptable): static { if (!$this->ecrituresComptables->contains($ecritureComptable)) { $this->ecrituresComptables->add($ecritureComptable); $ecritureComptable->setExercice($this); } return $this; } public function removeEcritureComptable(EcritureComptable $ecritureComptable): static { if ($this->ecrituresComptables->removeElement($ecritureComptable)) { if ($ecritureComptable->getExercice() === $this) { $ecritureComptable->setExercice(null); } } return $this; } public function getBoutique(): ?Boutique { return $this->boutique; } public function setBoutique(?Boutique $boutique): static { $this->boutique = $boutique; return $this; } public function getNotes(): ?string { return $this->notes; } public function setNotes(?string $notes): static { $this->notes = $notes; return $this; } public function __toString(): string { return $this->libelle ?? ''; }}