class EntityKmlDeriver in farmOS 2.x
Provides an action deriver for the KML action.
Hierarchy
- class \Drupal\Component\Plugin\Derivative\DeriverBase implements DeriverInterface
- class \Drupal\Core\Action\Plugin\Action\Derivative\EntityActionDeriverBase implements ContainerDeriverInterface uses StringTranslationTrait
- class \Drupal\farm_kml\Plugin\Action\Derivative\EntityKmlDeriver
- class \Drupal\Core\Action\Plugin\Action\Derivative\EntityActionDeriverBase implements ContainerDeriverInterface uses StringTranslationTrait
Expanded class hierarchy of EntityKmlDeriver
See also
\Drupal\farm_kml\Plugin\Action\EntityKml
File
- modules/
core/ kml/ src/ Plugin/ Action/ Derivative/ EntityKmlDeriver.php, line 13
Namespace
Drupal\farm_kml\Plugin\Action\DerivativeView source
class EntityKmlDeriver extends EntityActionDeriverBase {
/**
* {@inheritdoc}
*/
public function getDerivativeDefinitions($base_plugin_definition) {
if (empty($this->derivatives)) {
$definitions = [];
foreach ($this
->getApplicableEntityTypes() as $entity_type_id => $entity_type) {
$definition = $base_plugin_definition;
$definition['type'] = $entity_type_id;
$definition['label'] = $this
->t('Export @entity_type KML', [
'@entity_type' => $entity_type
->getSingularLabel(),
]);
$definitions[$entity_type_id] = $definition;
}
$this->derivatives = $definitions;
}
return parent::getDerivativeDefinitions($base_plugin_definition);
}
/**
* {@inheritdoc}
*/
protected function isApplicable(EntityTypeInterface $entity_type) {
return in_array($entity_type
->id(), [
'log',
'asset',
]);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DeriverBase:: |
protected | property | List of derivative definitions. | 1 |
DeriverBase:: |
public | function |
Gets the definition of a derivative plugin. Overrides DeriverInterface:: |
|
EntityActionDeriverBase:: |
protected | property | The entity type manager. | |
EntityActionDeriverBase:: |
public static | function |
Creates a new class instance. Overrides ContainerDeriverInterface:: |
|
EntityActionDeriverBase:: |
protected | function | Gets a list of applicable entity types. | |
EntityActionDeriverBase:: |
public | function | Constructs a new EntityActionDeriverBase object. | |
EntityKmlDeriver:: |
public | function |
Gets the definition of all derivatives of a base plugin. Overrides EntityActionDeriverBase:: |
|
EntityKmlDeriver:: |
protected | function |
Indicates whether the deriver can be used for the provided entity type. Overrides EntityActionDeriverBase:: |
|
StringTranslationTrait:: |
protected | property | The string translation service. | 4 |
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. |