2 namespace TYPO3\CMS\Lang\Domain\Model
;
5 * This file is part of the TYPO3 CMS project.
7 * It is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License, either version 2
9 * of the License, or any later version.
11 * For the full copyright and license information, please read the
12 * LICENSE.txt file that was distributed with this source code.
14 * The TYPO3 project - inspiring people to share!
17 use TYPO3\CMS\Extbase\DomainObject\AbstractEntity
;
22 class Language
extends AbstractEntity
27 protected $locale = '';
32 protected $label = '';
37 protected $selected = false;
42 protected $lastUpdate;
45 * Constructor of the language model
47 * @param string $locale
48 * @param string $label
49 * @param bool $selected
50 * @param int $lastUpdate
52 public function __construct($locale = '', $label = '', $selected = false, $lastUpdate = null)
54 $this->locale
= $locale;
55 $this->label
= $label;
56 $this->selected
= $selected;
57 $this->lastUpdate
= $lastUpdate;
63 public function getLastUpdate()
65 return $this->lastUpdate
;
69 * @param int $lastUpdate
71 public function setLastUpdate($lastUpdate)
73 $this->lastUpdate
= $lastUpdate;
77 * Setter for the language
79 * @param string $language the label of the language
82 public function setLabel($language)
84 $this->label
= $language;
88 * Getter for the language
92 public function getLabel()
98 * Setter for the locale
100 * @param string $locale the locale for the language like da, nl or de
103 public function setLocale($locale)
105 $this->locale
= $locale;
109 * Getter for the locale
113 public function getLocale()
115 return $this->locale
;
119 * Setter for the selected
121 * @param bool $selected whether the language is available or not
124 public function setSelected($selected)
126 $this->selected
= (bool)$selected;
130 * Getter for the selected
134 public function getSelected()
136 return $this->selected
;
140 * Returns an array represetation of current model
142 * @return array The properties
144 public function toArray()
147 'locale' => $this->getLocale(),
148 'label' => $this->getLabel(),
149 'selected' => $this->getSelected(),
150 'lastUpdate' => $this->getLastUpdate(),