<?php
namespace App\AtechNet\CoreBundle\Entity;
use Doctrine\ORM\Mapping\Column;
use Doctrine\ORM\Mapping\Entity;
use Doctrine\ORM\Mapping\OneToMany;
use Doctrine\ORM\Mapping\Table as Table;
use Doctrine\ORM\PersistentCollection;
use Doctrine\Common\Collections\ArrayCollection;
use Symfony\Component\Validator\Constraints as Assert;
/**
* Album
*
* @Table(name="languages")
* @Entity
*/
class Language extends AbstractSortableEntity
{
public const int LANGUAGE_ID_SK = 1;
public const int LANGUAGE_ID_HU = 2;
public const int LANGUAGE_ID_CZ = 3;
public const int LANGUAGE_ID_EN = 4;
public const int LANGUAGE_ID_DE = 5;
public const int LANGUAGE_ID_FR = 6;
public const int LANGUAGE_ID_IT = 7;
public const int LANGUAGE_ID_ES = 8;
public const int LANGUAGE_ID_NL = 9;
public const int LANGUAGE_ID_RO = 10;
public const int LANGUAGE_ID_SE = 11;
public const int LANGUAGE_ID_HR = 12;
public const int LANGUAGE_ID_SI = 13;
public const int LANGUAGE_ID_DK = 14;
public const int LANGUAGE_ID_IE = 15;
public const int LANGUAGE_ID_FI = 16;
public const int LANGUAGE_ID_PL = 17;
public const int LANGUAGE_ID_US = 27;
public const array SWITCHABLE_LANGUAGE_CODES = [
'en',
'sk',
'hu',
'cz',
'de',
'fr',
'it',
'es',
'nl',
'ro',
'se',
'hr',
'si',
'dk',
'ie',
'fi',
'pl',
'us'
];
/**
* @var string
*
* @Assert\NotNull
*
* @Column(name="code", type="text")
*/
private string $code;
/**
* @var string
*
* @Assert\NotNull
*
* @Column(name="name", type="text")
*/
private string $name;
/**
* @var PersistentCollection
*
* @Assert\Valid
*
* @OneToMany(targetEntity="Translation", mappedBy="language")
**/
private $translations;
/**
* @var PersistentCollection
*
* @OneToMany(targetEntity="Country", mappedBy="language")
**/
private $countries;
/**
* @return string
*/
public function getCode(): string
{
return $this->code;
}
/**
* @param string $code
*/
public function setCode(string $code): void
{
$this->code = $code;
}
/**
* @return string
*/
public function getName(): string
{
return $this->name;
}
/**
* @param string $name
*/
public function setName(string $name): void
{
$this->name = $name;
}
public function getTranslations()
{
return $this->translations;
}
public function getCountries()
{
return $this->countries;
}
}