<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass="App\Repository\TypenewsRepository")
*/
class Typenews
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $libelle;
/**
* @ORM\ManyToMany(targetEntity="App\Entity\News", mappedBy="type")
*/
private $news;
/**
* @ORM\Column(type="string", length=255)
*/
private $slug;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $libelle_en;
public function __construct()
{
$this->news = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getLibelle(): ?string
{
return $this->libelle;
}
public function setLibelle(string $libelle): self
{
$this->libelle = $libelle;
return $this;
}
/**
* @return Collection|News[]
*/
public function getNews(): Collection
{
return $this->news;
}
public function addNews(News $news): self
{
if (!$this->news->contains($news)) {
$this->news[] = $news;
$news->addType($this);
}
return $this;
}
public function removeNews(News $news): self
{
if ($this->news->contains($news)) {
$this->news->removeElement($news);
$news->removeType($this);
}
return $this;
}
public function getSlug(): ?string
{
return $this->slug;
}
public function setSlug(string $slug): self
{
$this->slug = $slug;
return $this;
}
public function getLibelleEn(): ?string
{
return $this->libelle_en;
}
public function setLibelleEn(?string $libelle_en): self
{
$this->libelle_en = $libelle_en;
return $this;
}
}