TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
lang/Classes/Domain/Model/Language.php
Go to the documentation of this file.
1 <?php
2 namespace TYPO3\CMS\Lang\Domain\Model;
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 
82  public function setLabel($language)
83  {
84  $this->label = $language;
85  }
86 
92  public function getLabel()
93  {
94  return $this->label;
95  }
96 
103  public function setLocale($locale)
104  {
105  $this->locale = $locale;
106  }
107 
113  public function getLocale()
114  {
115  return $this->locale;
116  }
117 
124  public function setSelected($selected)
125  {
126  $this->selected = (bool)$selected;
127  }
128 
134  public function getSelected()
135  {
136  return $this->selected;
137  }
138 
144  public function toArray()
145  {
146  return [
147  'locale' => $this->getLocale(),
148  'label' => $this->getLabel(),
149  'selected' => $this->getSelected(),
150  'lastUpdate' => $this->getLastUpdate(),
151  ];
152  }
153 }
__construct($locale= '', $label= '', $selected=false, $lastUpdate=null)