[TASK] Re-work/simplify copyright header in PHP files - Part 9
[Packages/TYPO3.CMS.git] / typo3 / sysext / extensionmanager / Classes / Domain / Model / Dependency.php
1 <?php
2 namespace TYPO3\CMS\Extensionmanager\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 /**
17 * Main extension model
18 *
19 * @author Susanne Moog <typo3@susannemoog.de>
20 */
21 class Dependency extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
22
23 /**
24 * @var string
25 */
26 protected $identifier = '';
27
28 /**
29 * @var string
30 */
31 protected $lowestVersion = '';
32
33 /**
34 * @var string
35 */
36 protected $highestVersion = '';
37
38 /**
39 * @var string
40 */
41 protected $type = '';
42
43 /**
44 * @var array
45 */
46 static protected $dependencyTypes = array(
47 'depends',
48 'conflicts',
49 'suggests'
50 );
51
52 /**
53 * @var array
54 */
55 static public $specialDependencies = array(
56 'typo3',
57 'php'
58 );
59
60 /**
61 * @param string $highestVersion
62 * @return void
63 */
64 public function setHighestVersion($highestVersion) {
65 $this->highestVersion = $highestVersion;
66 }
67
68 /**
69 * @return string
70 */
71 public function getHighestVersion() {
72 return $this->highestVersion;
73 }
74
75 /**
76 * @param string $identifier
77 * @return void
78 */
79 public function setIdentifier($identifier) {
80 $this->identifier = $identifier;
81 }
82
83 /**
84 * @return string
85 */
86 public function getIdentifier() {
87 return $this->identifier;
88 }
89
90 /**
91 * @param string $lowestVersion
92 * @return void
93 */
94 public function setLowestVersion($lowestVersion) {
95 $this->lowestVersion = $lowestVersion;
96 }
97
98 /**
99 * @return string
100 */
101 public function getLowestVersion() {
102 return $this->lowestVersion;
103 }
104
105 /**
106 * @param string $type
107 * @throws \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException if no valid dependency type was given
108 * @return void
109 */
110 public function setType($type) {
111 if (in_array($type, self::$dependencyTypes)) {
112 $this->type = $type;
113 } else {
114 throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException($type . ' was not a valid dependency type.');
115 }
116 }
117
118 /**
119 * @return string
120 */
121 public function getType() {
122 return $this->type;
123 }
124
125 }