86e6f5449d85f06ac81df2ff8f7457203a2550f3
[Packages/TYPO3.CMS.git] / typo3 / sysext / extensionmanager / Classes / Domain / Model / Dependency.php
1 <?php
2 namespace TYPO3\CMS\Extensionmanager\Domain\Model;
3
4 /***************************************************************
5 * Copyright notice
6 *
7 * (c) 2012-2013 Susanne Moog, <typo3@susannemoog.de>
8 * All rights reserved
9 *
10 * This script is part of the TYPO3 project. The TYPO3 project is
11 * free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 * The GNU General Public License can be found at
17 * http://www.gnu.org/copyleft/gpl.html.
18 * A copy is found in the text file GPL.txt and important notices to the license
19 * from the author is found in LICENSE.txt distributed with these scripts.
20 *
21 *
22 * This script is distributed in the hope that it will be useful,
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 * GNU General Public License for more details.
26 *
27 * This copyright notice MUST APPEAR in all copies of the script!
28 ***************************************************************/
29 /**
30 * Main extension model
31 *
32 * @author Susanne Moog <typo3@susannemoog.de>
33 */
34 class Dependency extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
35
36 /**
37 * @var string
38 */
39 protected $identifier = '';
40
41 /**
42 * @var string
43 */
44 protected $lowestVersion = '';
45
46 /**
47 * @var string
48 */
49 protected $highestVersion = '';
50
51 /**
52 * @var string
53 */
54 protected $type = '';
55
56 /**
57 * @var array
58 */
59 static protected $dependencyTypes = array(
60 'depends',
61 'conflicts',
62 'suggests'
63 );
64
65 /**
66 * @var array
67 */
68 static public $specialDependencies = array(
69 'typo3',
70 'php'
71 );
72
73 /**
74 * @param string $highestVersion
75 * @return void
76 */
77 public function setHighestVersion($highestVersion) {
78 $this->highestVersion = $highestVersion;
79 }
80
81 /**
82 * @return string
83 */
84 public function getHighestVersion() {
85 return $this->highestVersion;
86 }
87
88 /**
89 * @param string $identifier
90 * @return void
91 */
92 public function setIdentifier($identifier) {
93 $this->identifier = $identifier;
94 }
95
96 /**
97 * @return string
98 */
99 public function getIdentifier() {
100 return $this->identifier;
101 }
102
103 /**
104 * @param string $lowestVersion
105 * @return void
106 */
107 public function setLowestVersion($lowestVersion) {
108 $this->lowestVersion = $lowestVersion;
109 }
110
111 /**
112 * @return string
113 */
114 public function getLowestVersion() {
115 return $this->lowestVersion;
116 }
117
118 /**
119 * @param string $type
120 * @throws \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException if no valid dependency type was given
121 * @return void
122 */
123 public function setType($type) {
124 if (in_array($type, self::$dependencyTypes)) {
125 $this->type = $type;
126 } else {
127 throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException($type . ' was not a valid dependency type.');
128 }
129 }
130
131 /**
132 * @return string
133 */
134 public function getType() {
135 return $this->type;
136 }
137
138 }