src/Entity/System/Language.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity\System;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * @ORM\Table(name="ps_lang")
  7.  *
  8.  * @ORM\Entity(repositoryClass="App\Repository\System\LanguageRepository")
  9.  */
  10. class Language
  11. {
  12.     public const SPANISH_LANGUAGE_ID 4;
  13.     public const ENGLISH_LANGUAGE_ID 1;
  14.     public const ENGLISH_ISO 'en';
  15.     public const SPANISH_ISO 'es';
  16.     public const FRENCH_ISO 'fr';
  17.     public const ITALIAN_ISO 'it';
  18.     public const GERMAN_ISO 'de';
  19.     public const EMAIL_ENABLED_LANGUAGES = [self::ENGLISH_ISOself::SPANISH_ISOself::FRENCH_ISOself::ITALIAN_ISOself::GERMAN_ISO];
  20.     public const ENGLISH_NAME 'English';
  21.     public const LANG_IDS_INDEXED_BY_ISOCODE = [
  22.         'en' => 1,
  23.         'es' => 4,
  24.         'fr' => 5,
  25.         'de' => 6,
  26.         'pt' => 7,
  27.         'el' => 8,
  28.         'hr' => 9,
  29.         'it' => 10,
  30.         'et' => 11,
  31.         'da' => 12,
  32.         'fi' => 13,
  33.         'ro' => 14,
  34.         'bg' => 15,
  35.         'hu' => 16,
  36.         'sk' => 18,
  37.         'si' => 19,
  38.         'lt' => 20,
  39.         'lv' => 21,
  40.         'pl' => 22,
  41.         'nl' => 24,
  42.         'ru' => 25,
  43.         'no' => 26,
  44.         'sv' => 27,
  45.         'cs' => 28,
  46.     ];
  47.     /**
  48.      * @ORM\Id()
  49.      *
  50.      * @ORM\GeneratedValue()
  51.      *
  52.      * @ORM\Column(name="id_lang", type="integer", options={"unsigned":true})
  53.      */
  54.     private $id;
  55.     /**
  56.      * @ORM\Column(type="string", length=32)
  57.      */
  58.     private $name;
  59.     /**
  60.      * @ORM\Column(type="boolean", options={"unsigned":true, "default":0})
  61.      */
  62.     private $active;
  63.     /**
  64.      * @ORM\Column(type="string", length=2)
  65.      */
  66.     private $isoCode;
  67.     /**
  68.      * @ORM\Column(type="string", length=5)
  69.      */
  70.     private $languageCode;
  71.     /**
  72.      * @ORM\Column(type="string")
  73.      */
  74.     private $dateFormatLite;
  75.     /**
  76.      * @ORM\Column(type="string")
  77.      */
  78.     private $dateFormatFull;
  79.     /**
  80.      * @ORM\Column(type="string", length=32)
  81.      */
  82.     private $dictionary;
  83.     /**
  84.      * @ORM\Column(type="integer")
  85.      */
  86.     private $currencyFormat;
  87.     /**
  88.      * @ORM\Column(type="string", nullable=true)
  89.      */
  90.     private $isoCodeReal;
  91.     /**
  92.      * @ORM\Column(type="string", length=32, nullable=true)
  93.      */
  94.     private string $nameEnglish;
  95.     /**
  96.      * @ORM\OneToMany(targetEntity="App\Entity\System\CountryLanguage", mappedBy="language")
  97.      */
  98.     private $countryLanguages;
  99.     /**
  100.      * @ORM\OneToMany(targetEntity="App\Entity\System\Pack", mappedBy="language")
  101.      */
  102.     private $packs;
  103.     /**
  104.      * @ORM\OneToMany(targetEntity="App\Entity\System\Answer", mappedBy="language")
  105.      */
  106.     private $answers;
  107.     /**
  108.      * @ORM\OneToMany(targetEntity="Question", mappedBy="language")
  109.      */
  110.     private $questions;
  111.     public function __construct()
  112.     {
  113.         $this->packs = new ArrayCollection();
  114.         $this->countryLanguages = new ArrayCollection();
  115.         $this->questions = new ArrayCollection();
  116.         $this->answers = new ArrayCollection();
  117.     }
  118.     public function getId(): ?int
  119.     {
  120.         return $this->id;
  121.     }
  122.     public function getName(): ?string
  123.     {
  124.         return $this->name;
  125.     }
  126.     /**
  127.      * @return $this
  128.      */
  129.     public function setName(string $name): self
  130.     {
  131.         $this->name $name;
  132.         return $this;
  133.     }
  134.     public function getActive(): ?bool
  135.     {
  136.         return $this->active;
  137.     }
  138.     /**
  139.      * @return $this
  140.      */
  141.     public function setActive(bool $active): self
  142.     {
  143.         $this->active $active;
  144.         return $this;
  145.     }
  146.     public function getIsoCode(): ?string
  147.     {
  148.         return $this->isoCode;
  149.     }
  150.     /**
  151.      * @return $this
  152.      */
  153.     public function setIsoCode(string $isoCode): self
  154.     {
  155.         $this->isoCode $isoCode;
  156.         return $this;
  157.     }
  158.     public function getLanguageCode(): ?string
  159.     {
  160.         return $this->languageCode;
  161.     }
  162.     /**
  163.      * @return $this
  164.      */
  165.     public function setLanguageCode(string $languageCode): self
  166.     {
  167.         $this->languageCode $languageCode;
  168.         return $this;
  169.     }
  170.     public function getDateFormatLite(): string
  171.     {
  172.         return $this->dateFormatLite;
  173.     }
  174.     /**
  175.      * @return $this
  176.      */
  177.     public function setDateFormatLite(string $dateFormatLite): self
  178.     {
  179.         $this->dateFormatLite $dateFormatLite;
  180.         return $this;
  181.     }
  182.     public function getDateFormatFull(): string
  183.     {
  184.         return $this->dateFormatFull;
  185.     }
  186.     /**
  187.      * @return $this
  188.      */
  189.     public function setDateFormatFull(string $dateFormatFull): self
  190.     {
  191.         $this->dateFormatFull $dateFormatFull;
  192.         return $this;
  193.     }
  194.     public function getDictionary(): ?string
  195.     {
  196.         return $this->dictionary;
  197.     }
  198.     /**
  199.      * @return $this
  200.      */
  201.     public function setDictionary(string $dictionary): self
  202.     {
  203.         $this->dictionary $dictionary;
  204.         return $this;
  205.     }
  206.     public function getCurrencyFormat(): ?int
  207.     {
  208.         return $this->currencyFormat;
  209.     }
  210.     /**
  211.      * @return $this
  212.      */
  213.     public function setCurrencyFormat(int $currencyFormat): self
  214.     {
  215.         $this->currencyFormat $currencyFormat;
  216.         return $this;
  217.     }
  218.     public function getIsoCodeReal(): ?string
  219.     {
  220.         return $this->isoCodeReal;
  221.     }
  222.     /**
  223.      * @return $this
  224.      */
  225.     public function setIsoCodeReal(?string $isoCodeReal): self
  226.     {
  227.         $this->isoCodeReal $isoCodeReal;
  228.         return $this;
  229.     }
  230.     /**
  231.      * @return mixed
  232.      */
  233.     public function getNameEnglish()
  234.     {
  235.         return $this->nameEnglish;
  236.     }
  237.     /**
  238.      * @param mixed $nameEnglish
  239.      */
  240.     public function setNameEnglish($nameEnglish): void
  241.     {
  242.         $this->nameEnglish $nameEnglish;
  243.     }
  244.     /**
  245.      * @return ArrayCollection|CountryLanguage[]|null
  246.      */
  247.     public function getCountryLanguages()
  248.     {
  249.         return $this->countryLanguages;
  250.     }
  251.     /**
  252.      * @param ArrayCollection|CountryLanguage[]|null $countryLanguages
  253.      */
  254.     public function setCountryLanguages($countryLanguages): self
  255.     {
  256.         $this->countryLanguages $countryLanguages;
  257.         return $this;
  258.     }
  259.     /**
  260.      * @return ArrayCollection|Pack[]
  261.      */
  262.     public function getPacks()
  263.     {
  264.         return $this->packs;
  265.     }
  266.     /**
  267.      * @param ArrayCollection|Pack[] $packs
  268.      */
  269.     public function setPacks($packs): self
  270.     {
  271.         $this->packs $packs;
  272.         return $this;
  273.     }
  274.     public function getAnswers(): ArrayCollection
  275.     {
  276.         return $this->answers;
  277.     }
  278.     public function setAnswers(ArrayCollection $answers): self
  279.     {
  280.         $this->answers $answers;
  281.         return $this;
  282.     }
  283.     public function getQuestions(): ArrayCollection
  284.     {
  285.         return $this->questions;
  286.     }
  287.     public function setQuestions(ArrayCollection $questions): self
  288.     {
  289.         $this->questions $questions;
  290.         return $this;
  291.     }
  292. }