<?php
namespace App\CmsBundle\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass="App\CmsBundle\Repository\LocaleRepository")
*/
class Locale
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=5)
*/
private $title;
/**
* @ORM\ManyToMany(targetEntity="App\CmsBundle\Entity\Site", mappedBy="availableLocales")
*/
private $availableSites;
public function __construct(string $locale)
{
$this->setTitle($locale);
$this->availableSites = new ArrayCollection();
}
public function __toString() : string
{
return $this->getTitle();
}
public function getId(): ?int
{
return $this->id;
}
public function getTitle(): ?string
{
return $this->title;
}
public function setTitle(string $title): self
{
$this->title = $title;
return $this;
}
/**
* @return Collection|Site[]
*/
public function getAvailableSites(): Collection
{
return $this->availableSites;
}
}