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!
20 class Extension
extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
30 protected $title = '';
40 protected $iconWidth = 28;
45 protected $iconHeight = 28;
50 protected $version = '';
55 protected $updateResult = array();
58 * Constructor of the extension model.
60 * @param string $key The extension key
61 * @param string $title Title of the extension
62 * @param string $icon Icon representing the extension
64 public function __construct($key = '', $title= '', $icon = '')
67 $this->setTitle($title);
68 $this->setIcon($icon);
74 * @param string $icon ext_icon path relative to typo3 folder like ../typo3conf/ext/extensionkey/ext_icon.png
77 public function setIcon($icon)
85 * @return string ext_icon path relative to typo3 folder
87 public function getIcon()
95 public function getIconWidth()
97 return $this->iconWidth
;
101 * @param int $iconWidth
103 public function setIconWidth($iconWidth)
105 $this->iconWidth
= $iconWidth;
111 public function getIconHeight()
113 return $this->iconHeight
;
117 * @param int $iconHeight
119 public function setIconHeight($iconHeight)
121 $this->iconHeight
= $iconHeight;
130 public function setKey($key)
140 public function getKey()
146 * Setter for the title
148 * @param string $title
151 public function setTitle($title)
153 $this->title
= $title;
157 * Getter for the title
161 public function getTitle()
167 * Setter for the version
169 * @param int $version Needs to have a valid version format like 1003007
172 public function setVersion($version)
174 $this->version
= $version;
178 * Setter for the version from string
180 * @param string $version Needs to have a format like '1.3.7' and converts it into an integer like 1003007 before setting the version
181 * @see \TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger
184 public function setVersionFromString($version)
186 $this->version
= \TYPO3\CMS\Core\Utility\VersionNumberUtility
::convertVersionNumberToInteger($version);
190 * Getter for the version
192 * @return int interpretation of the extension version
194 public function getVersion()
196 return $this->version
;
200 * Setter for updateResult
202 * @param array $updateResult Needs to be in a structure like array('icon' => '', 'message' => '')
205 public function setUpdateResult($updateResult)
207 $this->updateResult
= (array)$updateResult;
211 * Getter for updateResult
213 * @return array returns the update result as an array in the structure like array('icon' => '', 'message' => '')
215 public function getUpdateResult()
217 return $this->updateResult
;
221 * Returns an array represetation of current model
223 * @return array The properties
225 public function toArray()
228 'key' => $this->getKey(),
229 'title' => $this->getTitle(),
230 'icon' => $this->getIcon(),
231 'version' => $this->getVersion(),
232 'width' => $this->getIconWidth(),
233 'height' => $this->getIconHeight()