src/AtechNet/CoreBundle/Entity/Language.php line 19

Open in your IDE?
  1. <?php
  2. namespace App\AtechNet\CoreBundle\Entity;
  3. use Doctrine\ORM\Mapping\Column;
  4. use Doctrine\ORM\Mapping\Entity;
  5. use Doctrine\ORM\Mapping\OneToMany;
  6. use Doctrine\ORM\Mapping\Table as Table;
  7. use Doctrine\ORM\PersistentCollection;
  8. use Doctrine\Common\Collections\ArrayCollection;
  9. use Symfony\Component\Validator\Constraints as Assert;
  10. /**
  11.  * Album
  12.  *
  13.  * @Table(name="languages")
  14.  * @Entity
  15.  */
  16. class Language extends AbstractSortableEntity
  17. {
  18.     public const int LANGUAGE_ID_SK = 1;
  19.     public const int LANGUAGE_ID_HU = 2;
  20.     public const int LANGUAGE_ID_CZ = 3;
  21.     public const int LANGUAGE_ID_EN = 4;
  22.     public const int LANGUAGE_ID_DE = 5;
  23.     public const int LANGUAGE_ID_FR = 6;
  24.     public const int LANGUAGE_ID_IT = 7;
  25.     public const int LANGUAGE_ID_ES = 8;
  26.     public const int LANGUAGE_ID_NL = 9;
  27.     public const int LANGUAGE_ID_RO = 10;
  28.     public const int LANGUAGE_ID_SE = 11;
  29.     public const int LANGUAGE_ID_HR = 12;
  30.     public const int LANGUAGE_ID_SI = 13;
  31.     public const int LANGUAGE_ID_DK = 14;
  32.     public const int LANGUAGE_ID_IE = 15;
  33.     public const int LANGUAGE_ID_FI = 16;
  34.     public const int LANGUAGE_ID_PL = 17;
  35.     public const int LANGUAGE_ID_US = 27;
  36.     public const array SWITCHABLE_LANGUAGE_CODES = [
  37.         'en',
  38.         'sk',
  39.         'hu',
  40.         'cz',
  41.         'de',
  42.         'fr',
  43.         'it',
  44.         'es',
  45.         'nl',
  46.         'ro',
  47.         'se',
  48.         'hr',
  49.         'si',
  50.         'dk',
  51.         'ie',
  52.         'fi',
  53.         'pl',
  54.         'us'
  55.     ];
  56.     /**
  57.      * @var string
  58.      *
  59.      * @Assert\NotNull
  60.      *
  61.      * @Column(name="code", type="text")
  62.      */
  63.     private string $code;
  64.     /**
  65.      * @var string
  66.      *
  67.      * @Assert\NotNull
  68.      *
  69.      * @Column(name="name", type="text")
  70.      */
  71.     private string $name;
  72.     /**
  73.      * @var PersistentCollection
  74.      *
  75.      * @Assert\Valid
  76.      *
  77.      * @OneToMany(targetEntity="Translation", mappedBy="language")
  78.      **/
  79.     private $translations;
  80.     /**
  81.      * @var PersistentCollection
  82.      *
  83.      * @OneToMany(targetEntity="Country", mappedBy="language")
  84.      **/
  85.     private $countries;
  86.     /**
  87.      * @return string
  88.      */
  89.     public function getCode(): string
  90.     {
  91.         return $this->code;
  92.     }
  93.     /**
  94.      * @param string $code
  95.      */
  96.     public function setCode(string $code): void
  97.     {
  98.         $this->code = $code;
  99.     }
  100.     /**
  101.      * @return string
  102.      */
  103.     public function getName(): string
  104.     {
  105.         return $this->name;
  106.     }
  107.     /**
  108.      * @param string $name
  109.      */
  110.     public function setName(string $name): void
  111.     {
  112.         $this->name = $name;
  113.     }
  114.     public function getTranslations()
  115.     {
  116.         return $this->translations;
  117.     }
  118.     public function getCountries()
  119.     {
  120.         return $this->countries;
  121.     }
  122. }