‪TYPO3CMS  ‪main
AbstractProvider.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
21 
26 abstract class ‪AbstractProvider implements ‪ProviderInterface
27 {
28  protected string ‪$identifier;
29  protected string ‪$label;
30 
31  public function ‪__invoke(array $attributes): self
32  {
33  if (!($attributes['label'] ?? false)) {
34  throw new \RuntimeException('Attribute \'label\' must be set to use ' . __CLASS__, 1606478090);
35  }
36 
37  $this->identifier = $attributes['identifier'];
38  $this->label = $attributes['label'];
39  return $this;
40  }
41 
42  public function ‪getIdentifier(): string
43  {
44  return ‪$this->identifier;
45  }
46 
47  public function ‪getLabel(): string
48  {
49  return $this->‪getLanguageService()->sL($this->label);
50  }
51 
53  {
54  return ‪$GLOBALS['LANG'];
55  }
56 }
‪TYPO3\CMS\Lowlevel\ConfigurationModuleProvider\AbstractProvider\$label
‪string $label
Definition: AbstractProvider.php:29
‪TYPO3\CMS\Lowlevel\ConfigurationModuleProvider\AbstractProvider\getIdentifier
‪getIdentifier()
Definition: AbstractProvider.php:42
‪TYPO3\CMS\Lowlevel\ConfigurationModuleProvider\AbstractProvider\getLabel
‪getLabel()
Definition: AbstractProvider.php:47
‪TYPO3\CMS\Lowlevel\ConfigurationModuleProvider\AbstractProvider\$identifier
‪string $identifier
Definition: AbstractProvider.php:28
‪TYPO3\CMS\Lowlevel\ConfigurationModuleProvider\AbstractProvider\getLanguageService
‪getLanguageService()
Definition: AbstractProvider.php:52
‪TYPO3\CMS\Lowlevel\ConfigurationModuleProvider\AbstractProvider
Definition: AbstractProvider.php:27
‪TYPO3\CMS\Lowlevel\ConfigurationModuleProvider
Definition: AbstractProvider.php:18
‪TYPO3\CMS\Lowlevel\ConfigurationModuleProvider\AbstractProvider\__invoke
‪__invoke(array $attributes)
Definition: AbstractProvider.php:31
‪TYPO3\CMS\Lowlevel\ConfigurationModuleProvider\ProviderInterface
Definition: ProviderInterface.php:24
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:25
‪TYPO3\CMS\Core\Localization\LanguageService
Definition: LanguageService.php:46