abstract class GlobalVariable in More Global Variables 8
Class GlobalVariable.
@package Drupal\mgv\Plugin
Hierarchy
- class \Drupal\mgv\Plugin\GlobalVariable implements GlobalVariableInterface uses StringTranslationTrait
Expanded class hierarchy of GlobalVariable
15 files declare their use of GlobalVariable
- BaseUrl.php in src/
Plugin/ GlobalVariable/ BaseUrl.php - CurrentLangcode.php in src/
Plugin/ GlobalVariable/ CurrentLangcode.php - CurrentLangname.php in src/
Plugin/ GlobalVariable/ CurrentLangname.php - CurrentPath.php in src/
Plugin/ GlobalVariable/ CurrentPath.php - CurrentPathAlias.php in src/
Plugin/ GlobalVariable/ CurrentPathAlias.php
1 string reference to 'GlobalVariable'
- MgvPluginManager::__construct in src/
MgvPluginManager.php - Constructs GlobalVariablePluginManager.
File
- src/
Plugin/ GlobalVariable.php, line 12
Namespace
Drupal\mgv\PluginView source
abstract class GlobalVariable implements GlobalVariableInterface {
use StringTranslationTrait;
private $configurations;
private $dependency;
/**
* GlobalVariable constructor.
*
* @param array $configurations
* Configuration that collected from createInstance() method.
*
* @see \Drupal\mgv\MgvPluginManager::createInstance()
*/
public function __construct(array $configurations) {
$this->configurations = $configurations;
$this->dependency = empty($this->configurations['variableDependencies']) ? [] : $this->configurations['variableDependencies'];
}
/**
* Dependency getter.
*
* @param string $id
* Name of dependency.
*
* @return array|mixed
* Value of dependent global variable.
*/
public function getDependency($id) {
return empty($this->dependency[$id]) ? NULL : $this->dependency[$id];
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
GlobalVariable:: |
private | property | ||
GlobalVariable:: |
private | property | ||
GlobalVariable:: |
public | function | Dependency getter. | |
GlobalVariable:: |
public | function | GlobalVariable constructor. | |
GlobalVariableInterface:: |
public | function | Method that implement generating value of global variable. | 15 |
StringTranslationTrait:: |
protected | property | The string translation service. | 1 |
StringTranslationTrait:: |
protected | function | Formats a string containing a count of items. | |
StringTranslationTrait:: |
protected | function | Returns the number of plurals supported by a given language. | |
StringTranslationTrait:: |
protected | function | Gets the string translation service. | |
StringTranslationTrait:: |
public | function | Sets the string translation service to use. | 2 |
StringTranslationTrait:: |
protected | function | Translates a string to the current language or to a given language. |