src/Entity/FormationMenu.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\FormationMenuRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=FormationMenuRepository::class)
  9.  */
  10. class FormationMenu
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="string", length=255)
  20.      */
  21.     private $wording
  22.     /**
  23.      * @ORM\Column(type="string", length=255)
  24.      */
  25.     private $longwording;
  26.     /**
  27.      * @ORM\ManyToMany(targetEntity=Formation::class, mappedBy="menu")
  28.      */
  29.     private $formations;
  30.     /**
  31.      * @ORM\Column(type="string", length=255)
  32.      */
  33.     private $value;
  34.     /**
  35.      * @ORM\Column(type="string", length=255)
  36.      */
  37.     private $icon;
  38.     public function __construct()
  39.     {
  40.         $this->formations = new ArrayCollection();
  41.     }  
  42.     public function __toString()
  43.     {
  44.         return $this->wording;
  45.     }
  46.     public function getId(): ?int
  47.     {
  48.         return $this->id;
  49.     }
  50.     public function getWording(): ?string
  51.     {
  52.         return $this->wording;
  53.     }
  54.     public function setWording(string $wording): self
  55.     {
  56.         $this->wording $wording;
  57.         return $this;
  58.     } 
  59.     public function getLongwording(): ?string
  60.     {
  61.         return $this->longwording;
  62.     }
  63.     public function setLongwording(string $longwording): self
  64.     {
  65.         $this->longwording $longwording;
  66.         return $this;
  67.     }
  68.     /**
  69.      * @return Collection<int, Formation>
  70.      */
  71.     public function getFormations(): Collection
  72.     {
  73.         return $this->formations;
  74.     }
  75.     public function addFormation(Formation $formation): self
  76.     {
  77.         if (!$this->formations->contains($formation)) {
  78.             $this->formations[] = $formation;
  79.             $formation->addMenu($this);
  80.         }
  81.         return $this;
  82.     }
  83.     public function removeFormation(Formation $formation): self
  84.     {
  85.         if ($this->formations->removeElement($formation)) {
  86.             $formation->removeMenu($this);
  87.         }
  88.         return $this;
  89.     }
  90.     public function getValue(): ?string
  91.     {
  92.         return $this->value;
  93.     }
  94.     public function setValue(string $value): self
  95.     {
  96.         $this->value $value;
  97.         return $this;
  98.     }
  99.     public function getIcon(): ?string
  100.     {
  101.         return $this->icon;
  102.     }
  103.     public function setIcon(string $icon): self
  104.     {
  105.         $this->icon $icon;
  106.         return $this;
  107.     }
  108. }