<?phpnamespace App\Entity;use App\Repository\MsnExerciceRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: MsnExerciceRepository::class)]class MsnExercice{ #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column] private ?int $id = null; #[ORM\Column(length: 255, nullable: true)] private ?string $nom = null; #[ORM\Column(length: 255, nullable: true)] private ?string $reference = null; #[ORM\OneToMany(targetEntity: MsnExerciceCategorie::class, mappedBy: 'msnExercice')] private Collection $msnExerciceCategories; #[ORM\Column(length: 50, nullable: true)] private ?string $numCompte = null; #[ORM\OneToMany(targetEntity: MsnExerOperation::class, mappedBy: 'exercice')] private Collection $msnExerOperations; #[ORM\OneToMany(targetEntity: Mission::class, mappedBy: 'exercice')] private Collection $missions; public function __construct() { $this->msnExerciceCategories = new ArrayCollection(); $this->msnExerOperations = new ArrayCollection(); $this->missions = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getNom(): ?string { return $this->nom; } public function setNom(?string $nom): static { $this->nom = $nom; return $this; } public function getReference(): ?string { return $this->reference; } public function setReference(?string $reference): static { $this->reference = $reference; return $this; } /** * @return Collection<int, MsnExerciceCategorie> */ public function getMsnExerciceCategories(): Collection { return $this->msnExerciceCategories; } public function addMsnExerciceCategory(MsnExerciceCategorie $msnExerciceCategory): static { if (!$this->msnExerciceCategories->contains($msnExerciceCategory)) { $this->msnExerciceCategories->add($msnExerciceCategory); $msnExerciceCategory->setMsnExercice($this); } return $this; } public function removeMsnExerciceCategory(MsnExerciceCategorie $msnExerciceCategory): static { if ($this->msnExerciceCategories->removeElement($msnExerciceCategory)) { // set the owning side to null (unless already changed) if ($msnExerciceCategory->getMsnExercice() === $this) { $msnExerciceCategory->setMsnExercice(null); } } return $this; } public function getNumCompte(): ?string { return $this->numCompte; } public function setNumCompte(?string $numCompte): static { $this->numCompte = $numCompte; return $this; } /** * @return Collection<int, MsnExerOperation> */ public function getMsnExerOperations(): Collection { return $this->msnExerOperations; } public function addMsnExerOperation(MsnExerOperation $msnExerOperation): static { if (!$this->msnExerOperations->contains($msnExerOperation)) { $this->msnExerOperations->add($msnExerOperation); $msnExerOperation->setExercice($this); } return $this; } public function removeMsnExerOperation(MsnExerOperation $msnExerOperation): static { if ($this->msnExerOperations->removeElement($msnExerOperation)) { // set the owning side to null (unless already changed) if ($msnExerOperation->getExercice() === $this) { $msnExerOperation->setExercice(null); } } return $this; } /** * @return Collection<int, Mission> */ public function getMissions(): Collection { return $this->missions; } public function addMission(Mission $mission): static { if (!$this->missions->contains($mission)) { $this->missions->add($mission); $mission->setExercice($this); } return $this; } public function removeMission(Mission $mission): static { if ($this->missions->removeElement($mission)) { // set the owning side to null (unless already changed) if ($mission->getExercice() === $this) { $mission->setExercice(null); } } return $this; }}