class EntityAliasTypeBase in View Mode Page 4.0.x
Same name and namespace in other branches
- 8.3 src/Plugin/view_mode_page/AliasType/EntityAliasTypeBase.php \Drupal\view_mode_page\Plugin\view_mode_page\AliasType\EntityAliasTypeBase
- 3.2.x src/Plugin/view_mode_page/AliasType/EntityAliasTypeBase.php \Drupal\view_mode_page\Plugin\view_mode_page\AliasType\EntityAliasTypeBase
A view_mode_page alias type plugin for entities with canonical links.
Plugin annotation
@AliasType(
id = "canonical_entities",
deriver = "\Drupal\view_mode_page\Plugin\Derivative\EntityAliasTypeDeriver"
)
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\Component\Plugin\ContextAwarePluginBase implements ContextAwarePluginInterface
- class \Drupal\Core\Plugin\ContextAwarePluginBase implements CacheableDependencyInterface, ContextAwarePluginInterface uses DependencySerializationTrait, ContextAwarePluginTrait, StringTranslationTrait, TypedDataTrait
- class \Drupal\view_mode_page\Plugin\view_mode_page\AliasType\EntityAliasTypeBase implements ContainerFactoryPluginInterface, AliasTypeInterface
- class \Drupal\Core\Plugin\ContextAwarePluginBase implements CacheableDependencyInterface, ContextAwarePluginInterface uses DependencySerializationTrait, ContextAwarePluginTrait, StringTranslationTrait, TypedDataTrait
- class \Drupal\Component\Plugin\ContextAwarePluginBase implements ContextAwarePluginInterface
Expanded class hierarchy of EntityAliasTypeBase
File
- src/
Plugin/ view_mode_page/ AliasType/ EntityAliasTypeBase.php, line 22
Namespace
Drupal\view_mode_page\Plugin\view_mode_page\AliasTypeView source
class EntityAliasTypeBase extends ContextAwarePluginBase implements AliasTypeInterface, ContainerFactoryPluginInterface {
/**
* The module handler service.
*
* @var \Drupal\Core\Extension\ModuleHandlerInterface
*/
protected $moduleHandler;
/**
* The language manager service.
*
* @var \Drupal\Core\Language\LanguageManagerInterface
*/
protected $languageManager;
/**
* The entity manager service.
*
* @var \Drupal\Core\Entity\EntityTypeManagerInterface
*/
protected $entityTypeManager;
/**
* Constructs a EntityAliasTypeBase instance.
*
* @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\Core\Extension\ModuleHandlerInterface $module_handler
* The module handler service.
* @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
* The language manager service.
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
* The entity manager service.
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition, ModuleHandlerInterface $module_handler, LanguageManagerInterface $language_manager, EntityTypeManagerInterface $entity_type_manager) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->moduleHandler = $module_handler;
$this->languageManager = $language_manager;
$this->entityTypeManager = $entity_type_manager;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
return new static($configuration, $plugin_id, $plugin_definition, $container
->get('module_handler'), $container
->get('language_manager'), $container
->get('entity_type.manager'));
}
/**
* {@inheritdoc}
*/
public function getLabel() {
$definition = $this
->getPluginDefinition();
// Cast the admin label to a string since it is an object.
// @see \Drupal\Core\StringTranslation\TranslationWrapper
return (string) $definition['label'];
}
/**
* {@inheritdoc}
*/
public function getTokenTypes() {
$definition = $this
->getPluginDefinition();
return $definition['types'];
}
/**
* Returns the entity type ID.
*
* @return string
* The entity type ID.
*/
protected function getEntityTypeId() {
return $this
->getDerivativeId();
}
/**
* {@inheritdoc}
*/
public function calculateDependencies() {
$dependencies = [];
$dependencies['module'][] = $this->entityTypeManager
->getDefinition($this
->getEntityTypeId())
->getProvider();
return $dependencies;
}
/**
* {@inheritdoc}
*/
public function applies($object) {
return $object instanceof FieldableEntityInterface && $object
->getEntityTypeId() == $this
->getEntityTypeId();
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ContextAwarePluginBase:: |
protected | function |
Overrides ContextAwarePluginBase:: |
|
ContextAwarePluginTrait:: |
protected | property | The data objects representing the context of this plugin. | |
ContextAwarePluginTrait:: |
protected | property | Tracks whether the context has been initialized from configuration. | |
ContextAwarePluginTrait:: |
public | function | 9 | |
ContextAwarePluginTrait:: |
public | function | 7 | |
ContextAwarePluginTrait:: |
public | function | 4 | |
ContextAwarePluginTrait:: |
public | function | ||
ContextAwarePluginTrait:: |
public | function | ||
ContextAwarePluginTrait:: |
public | function | ||
ContextAwarePluginTrait:: |
public | function | ||
ContextAwarePluginTrait:: |
public | function | ||
ContextAwarePluginTrait:: |
public | function | ||
ContextAwarePluginTrait:: |
public | function | ||
ContextAwarePluginTrait:: |
abstract protected | function | 1 | |
ContextAwarePluginTrait:: |
public | function | 1 | |
ContextAwarePluginTrait:: |
public | function | ||
ContextAwarePluginTrait:: |
public | function | ||
ContextAwarePluginTrait:: |
public | function | ||
DependencySerializationTrait:: |
protected | property | ||
DependencySerializationTrait:: |
protected | property | ||
DependencySerializationTrait:: |
public | function | 2 | |
DependencySerializationTrait:: |
public | function | 2 | |
EntityAliasTypeBase:: |
protected | property | The entity manager service. | |
EntityAliasTypeBase:: |
protected | property | The language manager service. | |
EntityAliasTypeBase:: |
protected | property | The module handler service. | |
EntityAliasTypeBase:: |
public | function |
Determines if this plugin type can apply a given object. Overrides AliasTypeInterface:: |
|
EntityAliasTypeBase:: |
public | function | ||
EntityAliasTypeBase:: |
public static | function |
Creates an instance of the plugin. Overrides ContainerFactoryPluginInterface:: |
|
EntityAliasTypeBase:: |
protected | function | Returns the entity type ID. | |
EntityAliasTypeBase:: |
public | function |
Get the label. Overrides AliasTypeInterface:: |
1 |
EntityAliasTypeBase:: |
public | function |
Get the token types. Overrides AliasTypeInterface:: |
|
EntityAliasTypeBase:: |
public | function |
Constructs a EntityAliasTypeBase instance. Overrides ContextAwarePluginBase:: |
|
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 plugin_id of the plugin instance. Overrides PluginInspectionInterface:: |
|
PluginBase:: |
public | function | Determines if the plugin is configurable. | |
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. | |
TypedDataTrait:: |
protected | property | The typed data manager used for creating the data types. | |
TypedDataTrait:: |
public | function | Gets the typed data manager. | 2 |
TypedDataTrait:: |
public | function | Sets the typed data manager. | 2 |