‪TYPO3CMS  11.5
MetaData.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
17 
19 
24 {
25  public const ‪CONSTRAINT_TYPE_DEPENDS = 'depends';
26  public const ‪CONSTRAINT_TYPE_CONFLICTS = 'conflicts';
27  public const ‪CONSTRAINT_TYPE_SUGGESTS = 'suggests';
28  private const ‪FRAMEWORK_TYPE = 'typo3-cms-framework';
29 
34 
38  protected ‪$packageKey;
39 
45  protected ‪$packageType;
46 
51  protected ‪$version;
52 
57  protected ‪$title;
58 
63  protected ‪$description;
64 
69  protected ‪$constraints = [];
70 
76  public function ‪getConstraintTypes()
77  {
79  }
80 
86  public function ‪__construct(‪$packageKey)
87  {
88  $this->packageKey = ‪$packageKey;
89  }
90 
94  public function ‪getPackageKey()
95  {
96  return ‪$this->packageKey;
97  }
98 
99  public function ‪isExtensionType(): bool
100  {
101  return is_string($this->packageType) && str_starts_with($this->packageType, 'typo3-cms-');
102  }
103 
104  public function ‪isFrameworkType(): bool
105  {
106  return $this->packageType === ‪self::FRAMEWORK_TYPE;
107  }
108 
114  public function ‪getPackageType()
115  {
116  return ‪$this->packageType;
117  }
118 
124  public function ‪setPackageType(‪$packageType)
125  {
126  $this->packageType = ‪$packageType;
127  }
128 
132  public function ‪getVersion()
133  {
134  return ‪$this->version;
135  }
136 
140  public function ‪setVersion(‪$version)
141  {
142  $this->version = ‪$version;
143  }
144 
145  public function ‪getTitle(): ?string
146  {
147  return ‪$this->title;
148  }
149 
150  public function ‪setTitle(?string ‪$title): void
151  {
152  $this->title = ‪$title;
153  }
154 
158  public function ‪getDescription()
159  {
160  return ‪$this->description;
161  }
162 
166  public function ‪setDescription(‪$description)
167  {
168  $this->description = ‪$description;
169  }
170 
176  public function ‪getConstraints()
177  {
178  return ‪$this->constraints;
179  }
180 
187  public function ‪getConstraintsByType($constraintType)
188  {
189  if (!isset($this->constraints[$constraintType])) {
190  return [];
191  }
192  return $this->constraints[$constraintType];
193  }
194 
200  public function ‪addConstraint(‪PackageConstraint $constraint)
201  {
202  $this->constraints[$constraint->‪getConstraintType()][] = $constraint;
203  }
204 }
‪TYPO3\CMS\Core\Package\MetaData\PackageConstraint\getConstraintType
‪string getConstraintType()
Definition: PackageConstraint.php:70
‪TYPO3\CMS\Core\Package\MetaData\setDescription
‪setDescription($description)
Definition: MetaData.php:159
‪TYPO3\CMS\Core\Package\MetaData\$version
‪string $version
Definition: MetaData.php:47
‪TYPO3\CMS\Core\Package\MetaData\getConstraintsByType
‪array getConstraintsByType($constraintType)
Definition: MetaData.php:180
‪TYPO3\CMS\Core\Package\MetaData\getConstraints
‪array getConstraints()
Definition: MetaData.php:169
‪TYPO3\CMS\Core\Package\MetaData\$constraints
‪array $constraints
Definition: MetaData.php:62
‪TYPO3\CMS\Core\Package\MetaData\getPackageKey
‪string getPackageKey()
Definition: MetaData.php:87
‪TYPO3\CMS\Core\Package\MetaData\$CONSTRAINT_TYPES
‪static array $CONSTRAINT_TYPES
Definition: MetaData.php:32
‪TYPO3\CMS\Core\Package\MetaData\CONSTRAINT_TYPE_SUGGESTS
‪const CONSTRAINT_TYPE_SUGGESTS
Definition: MetaData.php:27
‪TYPO3\CMS\Core\Package\MetaData\isFrameworkType
‪isFrameworkType()
Definition: MetaData.php:97
‪TYPO3\CMS\Core\Package\MetaData\getPackageType
‪string getPackageType()
Definition: MetaData.php:107
‪TYPO3\CMS\Core\Package\MetaData\getTitle
‪getTitle()
Definition: MetaData.php:138
‪TYPO3\CMS\Core\Package\MetaData\CONSTRAINT_TYPE_CONFLICTS
‪const CONSTRAINT_TYPE_CONFLICTS
Definition: MetaData.php:26
‪TYPO3\CMS\Core\Package\MetaData\__construct
‪__construct($packageKey)
Definition: MetaData.php:79
‪TYPO3\CMS\Core\Package\MetaData\setTitle
‪setTitle(?string $title)
Definition: MetaData.php:143
‪TYPO3\CMS\Core\Package\MetaData\setVersion
‪setVersion($version)
Definition: MetaData.php:133
‪TYPO3\CMS\Core\Package\MetaData\PackageConstraint
Definition: PackageConstraint.php:22
‪TYPO3\CMS\Core\Package\MetaData\setPackageType
‪setPackageType($packageType)
Definition: MetaData.php:117
‪TYPO3\CMS\Core\Package\MetaData\$packageType
‪string null $packageType
Definition: MetaData.php:42
‪TYPO3\CMS\Core\Package\MetaData\$description
‪string null $description
Definition: MetaData.php:57
‪TYPO3\CMS\Core\Package\MetaData\addConstraint
‪addConstraint(PackageConstraint $constraint)
Definition: MetaData.php:193
‪TYPO3\CMS\Core\Package\MetaData\FRAMEWORK_TYPE
‪const FRAMEWORK_TYPE
Definition: MetaData.php:28
‪TYPO3\CMS\Core\Package\MetaData\getVersion
‪string getVersion()
Definition: MetaData.php:125
‪TYPO3\CMS\Core\Package\MetaData\$packageKey
‪string $packageKey
Definition: MetaData.php:36
‪TYPO3\CMS\Core\Package\MetaData\getDescription
‪string null getDescription()
Definition: MetaData.php:151
‪TYPO3\CMS\Core\Package
Definition: AbstractServiceProvider.php:18
‪TYPO3\CMS\Core\Package\MetaData\$title
‪string null $title
Definition: MetaData.php:52
‪TYPO3\CMS\Core\Package\MetaData\isExtensionType
‪isExtensionType()
Definition: MetaData.php:92
‪TYPO3\CMS\Core\Package\MetaData
Definition: MetaData.php:24
‪TYPO3\CMS\Core\Package\MetaData\CONSTRAINT_TYPE_DEPENDS
‪const CONSTRAINT_TYPE_DEPENDS
Definition: MetaData.php:25
‪TYPO3\CMS\Core\Package\MetaData\getConstraintTypes
‪array getConstraintTypes()
Definition: MetaData.php:69