TYPO3 CMS  TYPO3_8-7
Language.php
Go to the documentation of this file.
1 <?php
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
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.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
16 
18 
22 class Language extends AbstractEntity
23 {
27  protected $locale = '';
28 
32  protected $label = '';
33 
37  protected $selected = false;
38 
42  protected $lastUpdate;
43 
52  public function __construct($locale = '', $label = '', $selected = false, $lastUpdate = null)
53  {
54  $this->locale = $locale;
55  $this->label = $label;
56  $this->selected = $selected;
57  $this->lastUpdate = $lastUpdate;
58  }
59 
63  public function getLastUpdate()
64  {
65  return $this->lastUpdate;
66  }
67 
71  public function setLastUpdate($lastUpdate)
72  {
73  $this->lastUpdate = $lastUpdate;
74  }
75 
81  public function setLabel($language)
82  {
83  $this->label = $language;
84  }
85 
91  public function getLabel()
92  {
93  return $this->label;
94  }
95 
101  public function setLocale($locale)
102  {
103  $this->locale = $locale;
104  }
105 
111  public function getLocale()
112  {
113  return $this->locale;
114  }
115 
121  public function setSelected($selected)
122  {
123  $this->selected = (bool)$selected;
124  }
125 
131  public function getSelected()
132  {
133  return $this->selected;
134  }
135 
141  public function toArray()
142  {
143  return [
144  'locale' => $this->getLocale(),
145  'label' => $this->getLabel(),
146  'selected' => $this->getSelected(),
147  'lastUpdate' => $this->getLastUpdate(),
148  ];
149  }
150 }
__construct($locale='', $label='', $selected=false, $lastUpdate=null)
Definition: Language.php:52