src/Entity/Sousmenu.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use App\Trait\TimestampableTrait;
  5. use App\Repository\SousmenuRepository;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\Common\Collections\ArrayCollection;
  8. use Symfony\Component\Validator\Constraints as Assert;
  9. #[ORM\Entity(repositoryClassSousmenuRepository::class)]
  10. #[ORM\HasLifecycleCallbacks]
  11. class Sousmenu
  12. {
  13.     use TimestampableTrait;
  14.     #[Assert\NotBlank]
  15.     #[ORM\ManyToOne(targetEntityMenu::class, inversedBy'sousmenus')]
  16.     private $menus;
  17.     
  18.     #[Assert\NotBlank]
  19.     #[ORM\Column(type'string'length255nullabletrue)]
  20.     private $intitule;
  21.     #[ORM\OneToMany(mappedBy'sousmenus'targetEntitySousmenu2::class)]
  22.     private $sousmenu2s;
  23.     
  24.     #[Assert\NotBlank]
  25.     #[ORM\Column(type'string'length255nullabletrue)]
  26.     private $path;
  27.     #[ORM\Column(type'text'nullabletrue)]
  28.     private $content;
  29.     #[ORM\Column(type'json',nullabletrue)]
  30.     private  $image = [];
  31.     #[ORM\Column(type'json',nullabletrue)]
  32.     private  $video = [];
  33.     #[ORM\OneToMany(mappedBy'sousmenu'targetEntityActualites::class)]
  34.     private $actualites;
  35.     #[ORM\OneToMany(mappedBy'sousmenu'targetEntityReportage::class)]
  36.     private $reportages;
  37.     #[ORM\OneToMany(mappedBy'sousmenu'targetEntityMembre::class)]
  38.     private $membres;
  39.     #[ORM\OneToMany(mappedBy'sousmenu'targetEntityAnnonces::class)]
  40.     private $annonces;
  41.     #[ORM\OneToMany(mappedBy'sousmenu'targetEntityMagazine::class)]
  42.     private $magazines;
  43.     #[ORM\Column]
  44.     private ?bool $statut null;
  45.     /* #[ORM\OneToMany(mappedBy: 'sousmenu', targetEntity: Produit::class)]
  46.     private $produits; */
  47.     public function __construct()
  48.     {
  49.         $this->sousmenu2s = new ArrayCollection();
  50.         $this->actualites = new ArrayCollection();
  51.         $this->reportages = new ArrayCollection();
  52.         $this->membres = new ArrayCollection();
  53.         $this->annonces = new ArrayCollection();
  54.         $this->produits = new ArrayCollection();
  55.         $this->magazines = new ArrayCollection();
  56.     }
  57.     
  58.     public function getMenus(): ?Menu
  59.     {
  60.         return $this->menus;
  61.     }
  62.     public function setMenus(?Menu $menus): self
  63.     {
  64.         $this->menus $menus;
  65.         return $this;
  66.     }
  67.     public function getIntitule(): ?string
  68.     {
  69.         return $this->intitule;
  70.     }
  71.     public function setIntitule(?string $intitule): self
  72.     {
  73.         $this->intitule $intitule;
  74.         return $this;
  75.     }
  76.     /**
  77.      * @return Collection<int, Sousmenu2>
  78.      */
  79.     public function getSousmenu2s(): Collection
  80.     {
  81.         return $this->sousmenu2s;
  82.     }
  83.     public function addSousmenu2(Sousmenu2 $sousmenu2): self
  84.     {
  85.         if (!$this->sousmenu2s->contains($sousmenu2)) {
  86.             $this->sousmenu2s[] = $sousmenu2;
  87.             $sousmenu2->setSousmenus($this);
  88.         }
  89.         return $this;
  90.     }
  91.     public function removeSousmenu2(Sousmenu2 $sousmenu2): self
  92.     {
  93.         if ($this->sousmenu2s->removeElement($sousmenu2)) {
  94.             // set the owning side to null (unless already changed)
  95.             if ($sousmenu2->getSousmenus() === $this) {
  96.                 $sousmenu2->setSousmenus(null);
  97.             }
  98.         }
  99.         return $this;
  100.     }
  101.     public function __toString()
  102.     {
  103.         return $this->intitule;
  104.     }
  105.     public function getPath(): ?string
  106.     {
  107.         return $this->path;
  108.     }
  109.     public function setPath(?string $path): self
  110.     {
  111.         $this->path $path;
  112.         return $this;
  113.     }
  114.     public function getContent(): ?string
  115.     {
  116.         return $this->content;
  117.     }
  118.     public function setContent(?string $content): self
  119.     {
  120.         $this->content $content;
  121.         return $this;
  122.     }
  123.     public function getImage(): array
  124.     {
  125.         return $this->image;
  126.     }
  127.     public function setImage(?array $image): self
  128.     {
  129.         $this->image $image;
  130.         return $this;
  131.     }
  132.     public function getVideo(): array
  133.     {
  134.         return $this->video;
  135.     }
  136.     public function setVideo(?array $video): self
  137.     {
  138.         $this->video $video;
  139.         return $this;
  140.     }
  141.     /**
  142.      * @return Collection<int, Actualites>
  143.      */
  144.     public function getActualites(): Collection
  145.     {
  146.         return $this->actualites;
  147.     }
  148.     public function addActualite(Actualites $actualite): self
  149.     {
  150.         if (!$this->actualites->contains($actualite)) {
  151.             $this->actualites[] = $actualite;
  152.             $actualite->setSousmenu($this);
  153.         }
  154.         return $this;
  155.     }
  156.     public function removeActualite(Actualites $actualite): self
  157.     {
  158.         if ($this->actualites->removeElement($actualite)) {
  159.             // set the owning side to null (unless already changed)
  160.             if ($actualite->getSousmenu() === $this) {
  161.                 $actualite->setSousmenu(null);
  162.             }
  163.         }
  164.         return $this;
  165.     }
  166.     /**
  167.      * @return Collection<int, Reportage>
  168.      */
  169.     public function getReportages(): Collection
  170.     {
  171.         return $this->reportages;
  172.     }
  173.     public function addReportage(Reportage $reportage): self
  174.     {
  175.         if (!$this->reportages->contains($reportage)) {
  176.             $this->reportages[] = $reportage;
  177.             $reportage->setSousmenu($this);
  178.         }
  179.         return $this;
  180.     }
  181.     public function removeReportage(Reportage $reportage): self
  182.     {
  183.         if ($this->reportages->removeElement($reportage)) {
  184.             // set the owning side to null (unless already changed)
  185.             if ($reportage->getSousmenu() === $this) {
  186.                 $reportage->setSousmenu(null);
  187.             }
  188.         }
  189.         return $this;
  190.     }
  191.     /**
  192.      * @return Collection<int, Membre>
  193.      */
  194.     public function getMembres(): Collection
  195.     {
  196.         return $this->membres;
  197.     }
  198.     public function addMembre(Membre $membre): self
  199.     {
  200.         if (!$this->membres->contains($membre)) {
  201.             $this->membres[] = $membre;
  202.             $membre->setSousmenu($this);
  203.         }
  204.         return $this;
  205.     }
  206.     public function removeMembre(Membre $membre): self
  207.     {
  208.         if ($this->membres->removeElement($membre)) {
  209.             // set the owning side to null (unless already changed)
  210.             if ($membre->getSousmenu() === $this) {
  211.                 $membre->setSousmenu(null);
  212.             }
  213.         }
  214.         return $this;
  215.     }
  216.     /**
  217.      * @return Collection<int, Annonces>
  218.      */
  219.     public function getAnnonces(): Collection
  220.     {
  221.         return $this->annonces;
  222.     }
  223.     public function addAnnonce(Annonces $annonce): self
  224.     {
  225.         if (!$this->annonces->contains($annonce)) {
  226.             $this->annonces[] = $annonce;
  227.             $annonce->setSousmenu($this);
  228.         }
  229.         return $this;
  230.     }
  231.     public function removeAnnonce(Annonces $annonce): self
  232.     {
  233.         if ($this->annonces->removeElement($annonce)) {
  234.             // set the owning side to null (unless already changed)
  235.             if ($annonce->getSousmenu() === $this) {
  236.                 $annonce->setSousmenu(null);
  237.             }
  238.         }
  239.         return $this;
  240.     }
  241.     /* /**
  242.      * @return Collection<int, Produit>
  243.      *
  244.     public function getProduits(): Collection
  245.     {
  246.         return $this->produits;
  247.     }
  248.     public function addProduit(Produit $produit): self
  249.     {
  250.         if (!$this->produits->contains($produit)) {
  251.             $this->produits[] = $produit;
  252.             $produit->setSousmenu($this);
  253.         }
  254.         return $this;
  255.     }
  256.     public function removeProduit(Produit $produit): self
  257.     {
  258.         if ($this->produits->removeElement($produit)) {
  259.             // set the owning side to null (unless already changed)
  260.             if ($produit->getSousmenu() === $this) {
  261.                 $produit->setSousmenu(null);
  262.             }
  263.         }
  264.         return $this;
  265.     }
  266.  */
  267.     /**
  268.      * @return Collection<int, Magazine>
  269.      */
  270.     public function getMagazines(): Collection
  271.     {
  272.         return $this->magazines;
  273.     }
  274.     public function addMagazine(Magazine $magazine): self
  275.     {
  276.         if (!$this->magazines->contains($magazine)) {
  277.             $this->magazines[] = $magazine;
  278.             $magazine->setSousmenu($this);
  279.         }
  280.         return $this;
  281.     }
  282.     public function removeMagazine(Magazine $magazine): self
  283.     {
  284.         if ($this->magazines->removeElement($magazine)) {
  285.             // set the owning side to null (unless already changed)
  286.             if ($magazine->getSousmenu() === $this) {
  287.                 $magazine->setSousmenu(null);
  288.             }
  289.         }
  290.         return $this;
  291.     }
  292.     public function isStatut(): ?bool
  293.     {
  294.         return $this->statut;
  295.     }
  296.     public function setStatut(bool $statut): self
  297.     {
  298.         $this->statut $statut;
  299.         return $this;
  300.     }
  301. }