abstract class DeriverBase in Drupal 7 to 8/9 Module Upgrader 8
Base class for DMU's plugin derivers. Sets up the translation service and provides a basic implementation of DeriverInterface::getDerivativeDefinition().
Hierarchy
- class \Drupal\drupalmoduleupgrader\DeriverBase implements ContainerDeriverInterface uses StringTranslationTrait
Expanded class hierarchy of DeriverBase
7 files declare their use of DeriverBase
- DBDeriver.php in src/
Plugin/ DMU/ Analyzer/ DBDeriver.php - DBDeriver.php in src/
Plugin/ DMU/ Converter/ Functions/ DBDeriver.php - DisableDeriver.php in src/
Plugin/ DMU/ Converter/ Functions/ DisableDeriver.php - EntityOperationDeriver.php in src/
Plugin/ DMU/ Converter/ Functions/ EntityOperationDeriver.php - FlagHookDeriver.php in src/
Plugin/ DMU/ Analyzer/ FlagHookDeriver.php
File
- src/
DeriverBase.php, line 14
Namespace
Drupal\drupalmoduleupgraderView source
abstract class DeriverBase implements ContainerDeriverInterface {
use StringTranslationTrait;
public function __construct(TranslationInterface $translator) {
$this->stringTranslation = $translator;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, $base_plugin_id) {
return new static($container
->get('string_translation'));
}
/**
* {@inheritdoc}
*/
public function getDerivativeDefinition($derivative_id, $base_definition) {
$derivatives = $this
->getDerivativeDefinitions($base_definition);
if (isset($derivatives[$derivative_id])) {
return $derivatives[$derivative_id];
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DeriverBase:: |
public static | function |
Creates a new class instance. Overrides ContainerDeriverInterface:: |
3 |
DeriverBase:: |
public | function |
Gets the definition of a derivative plugin. Overrides DeriverInterface:: |
|
DeriverBase:: |
public | function | 3 | |
DeriverInterface:: |
public | function | Gets the definition of all derivatives of a base plugin. | 14 |
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. |