src/Entity/Languages.php line 11
<?php
namespace App\Entity;
use App\Repository\LanguagesRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: LanguagesRepository::class)]
class Languages
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $locale = null;
#[ORM\Column(length: 255)]
private ?string $title = null;
#[ORM\OneToMany(mappedBy: 'language', targetEntity: StringTranslations::class)]
private Collection $stringTranslations;
public function __construct()
{
$this->stringTranslations = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getLocale(): ?string
{
return $this->locale;
}
public function setLocale(string $locale): self
{
$this->locale = $locale;
return $this;
}
public function getTitle(): ?string
{
return $this->title;
}
public function setTitle(string $title): self
{
$this->title = $title;
return $this;
}
/**
* @return Collection<int, StringTranslations>
*/
public function getStringTranslations(): Collection
{
return $this->stringTranslations;
}
public function addStringTranslation(StringTranslations $stringTranslation): self
{
if (!$this->stringTranslations->contains($stringTranslation)) {
$this->stringTranslations->add($stringTranslation);
$stringTranslation->setLanguage($this);
}
return $this;
}
public function removeStringTranslation(StringTranslations $stringTranslation): self
{
if ($this->stringTranslations->removeElement($stringTranslation)) {
// set the owning side to null (unless already changed)
if ($stringTranslation->getLanguage() === $this) {
$stringTranslation->setLanguage(null);
}
}
return $this;
}
}