src\Entity\Typenews.php line 10

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. #[ORM\Entity(repositoryClass\App\Repository\TypenewsRepository::class)]
  7. class Typenews
  8. {
  9.     #[ORM\Id]
  10.     #[ORM\GeneratedValue]
  11.     #[ORM\Column(type'integer')]
  12.     private $id;
  13.     #[ORM\Column(type'string'length255)]
  14.     private $libelle;
  15.     #[ORM\ManyToMany(targetEntity\App\Entity\News::class, mappedBy'type')]
  16.     private $news;
  17.     #[ORM\Column(type'string'length255)]
  18.     private $slug;
  19.     #[ORM\Column(type'string'length255nullabletrue)]
  20.     private $libelle_en;
  21.     public function __construct()
  22.     {
  23.         $this->news = new ArrayCollection();
  24.     }
  25.     public function getId(): ?int
  26.     {
  27.         return $this->id;
  28.     }
  29.     public function getLibelle(): ?string
  30.     {
  31.         return $this->libelle;
  32.     }
  33.     public function setLibelle(string $libelle): self
  34.     {
  35.         $this->libelle $libelle;
  36.         return $this;
  37.     }
  38.     /**
  39.      * @return Collection|News[]
  40.      */
  41.     public function getNews(): Collection
  42.     {
  43.         return $this->news;
  44.     }
  45.     public function addNews(News $news): self
  46.     {
  47.         if (!$this->news->contains($news)) {
  48.             $this->news[] = $news;
  49.             $news->addType($this);
  50.         }
  51.         return $this;
  52.     }
  53.     public function removeNews(News $news): self
  54.     {
  55.         if ($this->news->contains($news)) {
  56.             $this->news->removeElement($news);
  57.             $news->removeType($this);
  58.         }
  59.         return $this;
  60.     }
  61.     public function getSlug(): ?string
  62.     {
  63.         return $this->slug;
  64.     }
  65.     public function setSlug(string $slug): self
  66.     {
  67.         $this->slug $slug;
  68.         return $this;
  69.     }
  70.     public function getLibelleEn(): ?string
  71.     {
  72.         return $this->libelle_en;
  73.     }
  74.     public function setLibelleEn(?string $libelle_en): self
  75.     {
  76.         $this->libelle_en $libelle_en;
  77.         return $this;
  78.     }
  79. }