abstract class DiffGeneratorPluginBase in Entity Share 8.3
Base class for Diff plugins.
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\entity_share_diff\DiffGenerator\DiffGeneratorPluginBase implements ContainerFactoryPluginInterface, DiffGeneratorInterface uses StringTranslationTrait
Expanded class hierarchy of DiffGeneratorPluginBase
8 files declare their use of DiffGeneratorPluginBase
- CommentFieldDiffParser.php in modules/
entity_share_diff/ src/ Plugin/ DiffGenerator/ CommentFieldDiffParser.php - CoreFieldDiffParser.php in modules/
entity_share_diff/ src/ Plugin/ DiffGenerator/ CoreFieldDiffParser.php - EntityReferenceFieldDiffParser.php in modules/
entity_share_diff/ src/ Plugin/ DiffGenerator/ EntityReferenceFieldDiffParser.php - FileFieldDiffParser.php in modules/
entity_share_diff/ src/ Plugin/ DiffGenerator/ FileFieldDiffParser.php - LinkFieldDiffParser.php in modules/
entity_share_diff/ src/ Plugin/ DiffGenerator/ LinkFieldDiffParser.php
File
- modules/
entity_share_diff/ src/ DiffGenerator/ DiffGeneratorPluginBase.php, line 19
Namespace
Drupal\entity_share_diff\DiffGeneratorView source
abstract class DiffGeneratorPluginBase extends PluginBase implements DiffGeneratorInterface, ContainerFactoryPluginInterface {
use StringTranslationTrait;
/**
* The remote manager service.
*
* @var \Drupal\entity_share_client\Service\RemoteManagerInterface
*/
protected $remoteManager;
/**
* The entity type manager.
*
* @var \Drupal\Core\Entity\EntityTypeManagerInterface
*/
protected $entityTypeManager;
/**
* The entity parser service.
*
* @var \Drupal\entity_share_diff\Service\EntityParserInterface
*/
protected $entityParser;
/**
* The 'Remote' entity.
*
* @var \Drupal\entity_share_client\Entity\RemoteInterface
*/
protected $remote;
/**
* Constructs a DiffManagerBase object.
*
* @param array $configuration
* A configuration array containing information about the plugin instance.
* @param string $plugin_id
* The plugin_id for the plugin instance.
* @param mixed $plugin_definition
* The plugin implementation definition.
* @param \Drupal\entity_share_client\Service\RemoteManagerInterface $remoteManager
* The remote manager service.
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
* The entity type manager.
* @param \Drupal\entity_share_diff\Service\EntityParserInterface $entity_parser
* The entity parser service.
*/
public function __construct(array $configuration, string $plugin_id, $plugin_definition, RemoteManagerInterface $remoteManager, EntityTypeManagerInterface $entity_type_manager, EntityParserInterface $entity_parser) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->remoteManager = $remoteManager;
$this->entityTypeManager = $entity_type_manager;
$this->entityParser = $entity_parser;
$this->remote = NULL;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
return new static($configuration, $plugin_id, $plugin_definition, $container
->get('entity_share_client.remote_manager'), $container
->get('entity_type.manager'), $container
->get('entity_share_diff.entity_parser'));
}
/**
* Returns Remote entity.
*/
public function getRemote() {
return $this->remote;
}
/**
* Sets Remote entity.
*/
public function setRemote($remote) {
$this->remote = $remote;
}
/**
* {@inheritdoc}
*/
public static function isApplicable(FieldStorageDefinitionInterface $field_definition) {
return TRUE;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DiffGeneratorInterface:: |
public | function | Builds an array of strings. | 8 |
DiffGeneratorPluginBase:: |
protected | property | The entity parser service. | |
DiffGeneratorPluginBase:: |
protected | property | The entity type manager. | |
DiffGeneratorPluginBase:: |
protected | property | The 'Remote' entity. | |
DiffGeneratorPluginBase:: |
protected | property | The remote manager service. | |
DiffGeneratorPluginBase:: |
public static | function |
Creates an instance of the plugin. Overrides ContainerFactoryPluginInterface:: |
|
DiffGeneratorPluginBase:: |
public | function | Returns Remote entity. | |
DiffGeneratorPluginBase:: |
public static | function |
Returns if the plugin can be used for the provided field. Overrides DiffGeneratorInterface:: |
|
DiffGeneratorPluginBase:: |
public | function | Sets Remote entity. | |
DiffGeneratorPluginBase:: |
public | function |
Constructs a DiffManagerBase object. Overrides PluginBase:: |
|
PluginBase:: |
protected | property | Configuration information passed into the plugin. | 1 |
PluginBase:: |
protected | property | The plugin implementation definition. | 1 |
PluginBase:: |
protected | property | The plugin_id. | |
PluginBase:: |
constant | A string which is used to separate base plugin IDs from the derivative ID. | ||
PluginBase:: |
public | function |
Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the definition of the plugin implementation. Overrides PluginInspectionInterface:: |
3 |
PluginBase:: |
public | function |
Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface:: |
|
PluginBase:: |
public | function | Determines if the plugin is configurable. | |
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. |