src/Entity/System/Language.php line 20

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