abstract class WebformEntityPrintWebformDeriverBase in Webform 6.x
Same name and namespace in other branches
- 8.5 modules/webform_entity_print/src/Plugin/Derivative/WebformEntityPrintWebformDeriverBase.php \Drupal\webform_entity_print\Plugin\Derivative\WebformEntityPrintWebformDeriverBase
Provides base deriver for webform entity print plugins.
Hierarchy
- class \Drupal\Component\Plugin\Derivative\DeriverBase implements DeriverInterface
- class \Drupal\webform_entity_print\Plugin\Derivative\WebformEntityPrintWebformDeriverBase implements ContainerDeriverInterface uses StringTranslationTrait
Expanded class hierarchy of WebformEntityPrintWebformDeriverBase
1 file declares its use of WebformEntityPrintWebformDeriverBase
- WebformEntityPrintAttachmentDeriver.php in modules/
webform_entity_print_attachment/ src/ Plugin/ Derivative/ WebformEntityPrintAttachmentDeriver.php
File
- modules/
webform_entity_print/ src/ Plugin/ Derivative/ WebformEntityPrintWebformDeriverBase.php, line 13
Namespace
Drupal\webform_entity_print\Plugin\DerivativeView source
abstract class WebformEntityPrintWebformDeriverBase extends DeriverBase implements ContainerDeriverInterface {
use StringTranslationTrait;
/**
* The entity print export type manager.
*
* @var \Drupal\entity_print\Plugin\ExportTypeManagerInterface
*/
protected $exportTypeManager;
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, $base_plugin_id) {
$instance = new static();
$instance->exportTypeManager = $container
->get('plugin.manager.entity_print.export_type');
return $instance;
}
/**
* {@inheritdoc}
*/
public function getDerivativeDefinitions($base_plugin_definition) {
return [];
}
/**
* Get export type definitions.
*
* @return array
* An array of export type definitions.
*/
protected function getDefinitions() {
$definitions = $this->exportTypeManager
->getDefinitions();
// Remove unsupported export types.
// Issue #2733781: Add Export to Word Support.
// @see https://www.drupal.org/project/entity_print/issues/2733781
unset($definitions['word_docx']);
// Issue #2735559: Add Export to ePub.
// @see https://www.drupal.org/project/entity_print/issues/2735559
unset($definitions['epub']);
return $definitions;
}
}
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:: |
|
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. | |
WebformEntityPrintWebformDeriverBase:: |
protected | property | The entity print export type manager. | |
WebformEntityPrintWebformDeriverBase:: |
public static | function |
Creates a new class instance. Overrides ContainerDeriverInterface:: |
|
WebformEntityPrintWebformDeriverBase:: |
protected | function | Get export type definitions. | |
WebformEntityPrintWebformDeriverBase:: |
public | function |
Gets the definition of all derivatives of a base plugin. Overrides DeriverBase:: |
2 |