<?php
namespace App\Entity;
use App\Repository\LangRepository;
use App\Traits\CommonTrt;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=LangRepository::class)
*/
class Lang
{
use CommonTrt;
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $name;
/**
* @ORM\Column(type="string", length=255)
*/
private $slug;
/**
* @ORM\OneToMany(targetEntity=Header::class, mappedBy="langue")
*/
private $headers;
/**
* @ORM\OneToMany(targetEntity=About::class, mappedBy="langue")
*/
private $abouts;
/**
* @ORM\OneToMany(targetEntity=Titles::class, mappedBy="langue")
*/
private $titles;
/**
* @ORM\OneToMany(targetEntity=News::class, mappedBy="langue")
*/
private $news;
/**
* @ORM\OneToMany(targetEntity=Faqs::class, mappedBy="langue")
*/
private $faqs;
/**
* @ORM\OneToMany(targetEntity=Activities::class, mappedBy="langue")
*/
private $activities;
public function __construct()
{
$this->headers = new ArrayCollection();
$this->abouts = new ArrayCollection();
$this->titles = new ArrayCollection();
$this->news = new ArrayCollection();
$this->faqs = new ArrayCollection();
$this->activities = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getSlug(): ?string
{
return $this->slug;
}
public function setSlug(string $slug): self
{
$this->slug = $slug;
return $this;
}
/**
* @return Collection<int, Header>
*/
public function getHeaders(): Collection
{
return $this->headers;
}
public function addHeader(Header $header): self
{
if (!$this->headers->contains($header)) {
$this->headers[] = $header;
$header->setLangue($this);
}
return $this;
}
public function removeHeader(Header $header): self
{
if ($this->headers->removeElement($header)) {
// set the owning side to null (unless already changed)
if ($header->getLangue() === $this) {
$header->setLangue(null);
}
}
return $this;
}
/**
* @return Collection<int, About>
*/
public function getAbouts(): Collection
{
return $this->abouts;
}
public function addAbout(About $about): self
{
if (!$this->abouts->contains($about)) {
$this->abouts[] = $about;
$about->setLangue($this);
}
return $this;
}
public function removeAbout(About $about): self
{
if ($this->abouts->removeElement($about)) {
// set the owning side to null (unless already changed)
if ($about->getLangue() === $this) {
$about->setLangue(null);
}
}
return $this;
}
/**
* @return Collection<int, Titles>
*/
public function getTitles(): Collection
{
return $this->titles;
}
public function addTitle(Titles $title): self
{
if (!$this->titles->contains($title)) {
$this->titles[] = $title;
$title->setLangue($this);
}
return $this;
}
public function removeTitle(Titles $title): self
{
if ($this->titles->removeElement($title)) {
// set the owning side to null (unless already changed)
if ($title->getLangue() === $this) {
$title->setLangue(null);
}
}
return $this;
}
/**
* @return Collection<int, News>
*/
public function getNews(): Collection
{
return $this->news;
}
public function addNews(News $news): self
{
if (!$this->news->contains($news)) {
$this->news[] = $news;
$news->setLangue($this);
}
return $this;
}
public function removeNews(News $news): self
{
if ($this->news->removeElement($news)) {
// set the owning side to null (unless already changed)
if ($news->getLangue() === $this) {
$news->setLangue(null);
}
}
return $this;
}
/**
* @return Collection<int, Faqs>
*/
public function getFaqs(): Collection
{
return $this->faqs;
}
public function addFaq(Faqs $faq): self
{
if (!$this->faqs->contains($faq)) {
$this->faqs[] = $faq;
$faq->setLangue($this);
}
return $this;
}
public function removeFaq(Faqs $faq): self
{
if ($this->faqs->removeElement($faq)) {
// set the owning side to null (unless already changed)
if ($faq->getLangue() === $this) {
$faq->setLangue(null);
}
}
return $this;
}
/**
* @return Collection<int, Activities>
*/
public function getActivities(): Collection
{
return $this->activities;
}
public function addActivity(Activities $activity): self
{
if (!$this->activities->contains($activity)) {
$this->activities[] = $activity;
$activity->setLangue($this);
}
return $this;
}
public function removeActivity(Activities $activity): self
{
if ($this->activities->removeElement($activity)) {
// set the owning side to null (unless already changed)
if ($activity->getLangue() === $this) {
$activity->setLangue(null);
}
}
return $this;
}
}