Loading src/Entity/Parametre.php +21 −2 Changes for src/Entity/Parametre.php: 21 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -3,11 +3,16 @@ namespace Unicaen\Parametre\Entity; use ApiPlatform\Metadata\ApiResource; use ApiPlatform\OpenApi\Model\Operation; use Doctrine\ORM\Mapping as ORM; #[ORM\Entity] #[ORM\Table(name: 'unicaen_parametre')] #[ApiResource] #[ORM\Table(name: 'unicaen_parametre_parametre')] #[ApiResource( openapi: new Operation( tags: ['unicaen_parametre Parametres'], ) )] class Parametre { #[ORM\Id] Loading Loading @@ -39,6 +44,10 @@ class Parametre #[ORM\Column(type: 'boolean')] private bool $affichable = true; #[ORM\ManyToOne(targetEntity: ParametreCategorie::class, inversedBy: 'parametres')] #[ORM\JoinColumn(name: 'categorie_id', referencedColumnName: 'id')] private ?ParametreCategorie $categorie = null; public function getId(): ?int { return $this->id; Loading Loading @@ -139,4 +148,14 @@ class Parametre return $this; } public function getCategorie(): ?ParametreCategorie { return $this->categorie; } public function setCategorie(?ParametreCategorie $categorie): void { $this->categorie = $categorie; } } src/Entity/CategorieParametre.php→src/Entity/ParametreCategorie.php +36 −3 Changes for src/Entity/ParametreCategorie.php: 36 added lines, 3 removed lines. Original line number Diff line number Diff line Loading @@ -3,13 +3,19 @@ namespace Unicaen\Parametre\Entity; use ApiPlatform\Metadata\ApiResource; use ApiPlatform\OpenApi\Model\Operation; use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; #[ORM\Entity] #[ORM\Table(name: 'unicaen_parametre_categorie')] #[ApiResource] class CategorieParametre #[ApiResource( shortName: 'parametre-categories', openapi: new Operation( tags: ['unicaen_parametre Categorie'], ) )] class ParametreCategorie { #[ORM\Id] #[ORM\GeneratedValue] Loading @@ -28,7 +34,7 @@ class CategorieParametre #[ORM\Column(type: 'integer')] private ?int $ordre; #[ORM\OneToMany(targetEntity: Parametre::class, mappedBy: 'categorie')] #[ORM\OneToMany(targetEntity: Parametre::class, mappedBy: 'categorie', cascade: ['remove'], orphanRemoval: true)] private Collection $parametres; public function getId(): ?int Loading Loading @@ -83,4 +89,31 @@ class CategorieParametre return $this; } public function getParametres(): Collection { return $this->parametres; } public function addParametre(Parametre $parametre): static { if (!$this->parametres->contains($parametre)) { $this->parametres[] = $parametre; $parametre->setCategorie($this); } return $this; } public function removeParametre(Parametre $parametre): static { if ($this->parametres->removeElement($parametre)) { // set the owning side to null (unless already changed) if ($parametre->getCategorie() === $this) { $parametre->setCategorie(null); } } return $this; } } Loading
src/Entity/Parametre.php +21 −2 Changes for src/Entity/Parametre.php: 21 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -3,11 +3,16 @@ namespace Unicaen\Parametre\Entity; use ApiPlatform\Metadata\ApiResource; use ApiPlatform\OpenApi\Model\Operation; use Doctrine\ORM\Mapping as ORM; #[ORM\Entity] #[ORM\Table(name: 'unicaen_parametre')] #[ApiResource] #[ORM\Table(name: 'unicaen_parametre_parametre')] #[ApiResource( openapi: new Operation( tags: ['unicaen_parametre Parametres'], ) )] class Parametre { #[ORM\Id] Loading Loading @@ -39,6 +44,10 @@ class Parametre #[ORM\Column(type: 'boolean')] private bool $affichable = true; #[ORM\ManyToOne(targetEntity: ParametreCategorie::class, inversedBy: 'parametres')] #[ORM\JoinColumn(name: 'categorie_id', referencedColumnName: 'id')] private ?ParametreCategorie $categorie = null; public function getId(): ?int { return $this->id; Loading Loading @@ -139,4 +148,14 @@ class Parametre return $this; } public function getCategorie(): ?ParametreCategorie { return $this->categorie; } public function setCategorie(?ParametreCategorie $categorie): void { $this->categorie = $categorie; } }
src/Entity/CategorieParametre.php→src/Entity/ParametreCategorie.php +36 −3 Changes for src/Entity/ParametreCategorie.php: 36 added lines, 3 removed lines. Original line number Diff line number Diff line Loading @@ -3,13 +3,19 @@ namespace Unicaen\Parametre\Entity; use ApiPlatform\Metadata\ApiResource; use ApiPlatform\OpenApi\Model\Operation; use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; #[ORM\Entity] #[ORM\Table(name: 'unicaen_parametre_categorie')] #[ApiResource] class CategorieParametre #[ApiResource( shortName: 'parametre-categories', openapi: new Operation( tags: ['unicaen_parametre Categorie'], ) )] class ParametreCategorie { #[ORM\Id] #[ORM\GeneratedValue] Loading @@ -28,7 +34,7 @@ class CategorieParametre #[ORM\Column(type: 'integer')] private ?int $ordre; #[ORM\OneToMany(targetEntity: Parametre::class, mappedBy: 'categorie')] #[ORM\OneToMany(targetEntity: Parametre::class, mappedBy: 'categorie', cascade: ['remove'], orphanRemoval: true)] private Collection $parametres; public function getId(): ?int Loading Loading @@ -83,4 +89,31 @@ class CategorieParametre return $this; } public function getParametres(): Collection { return $this->parametres; } public function addParametre(Parametre $parametre): static { if (!$this->parametres->contains($parametre)) { $this->parametres[] = $parametre; $parametre->setCategorie($this); } return $this; } public function removeParametre(Parametre $parametre): static { if ($this->parametres->removeElement($parametre)) { // set the owning side to null (unless already changed) if ($parametre->getCategorie() === $this) { $parametre->setCategorie(null); } } return $this; } }