class ViewRevisionsConverter in Config Entity Revisions 8.2
Same name in this branch
- 8.2 modules/view_revisions/src/ParamConverter/ViewRevisionsConverter.php \Drupal\view_revisions\ParamConverter\ViewRevisionsConverter
- 8.2 modules/view_revisions/src/ProxyClass/ParamConverter/ViewRevisionsConverter.php \Drupal\view_revisions\ProxyClass\ParamConverter\ViewRevisionsConverter
Provides upcasting for a view entity with revisions support.
Example:
pattern: '/some/{view}/{revision_id}/and/{bar}' options: parameters: view: type: 'entity:view' tempstore: TRUE revision_id: \+d
The value for {view} will be converted to a view entity prepared for the Views UI and loaded from the views temp store, but it will not touch the value for {bar}.
This class extends AdminPathConfigEntityConverter rather than ViewUIConverter so that ViewUIConverter's converter can be replaced rather than extended (we call the parent method). Other methods should remain the same as ViewUIConverter.
Hierarchy
- class \Drupal\Core\ParamConverter\EntityConverter implements ParamConverterInterface uses DeprecatedServicePropertyTrait, DynamicEntityTypeParamConverterTrait
- class \Drupal\Core\ParamConverter\AdminPathConfigEntityConverter
- class \Drupal\config_entity_revisions\ConfigEntityRevisionsConverterBase implements ConfigEntityRevisionsConverterBaseInterface
- class \Drupal\view_revisions\ParamConverter\ViewRevisionsConverter implements ParamConverterInterface
- class \Drupal\config_entity_revisions\ConfigEntityRevisionsConverterBase implements ConfigEntityRevisionsConverterBaseInterface
- class \Drupal\Core\ParamConverter\AdminPathConfigEntityConverter
Expanded class hierarchy of ViewRevisionsConverter
1 string reference to 'ViewRevisionsConverter'
- view_revisions.services.yml in modules/
view_revisions/ view_revisions.services.yml - modules/view_revisions/view_revisions.services.yml
1 service uses ViewRevisionsConverter
File
- modules/
view_revisions/ src/ ParamConverter/ ViewRevisionsConverter.php, line 33
Namespace
Drupal\view_revisions\ParamConverterView source
class ViewRevisionsConverter extends ConfigEntityRevisionsConverterBase implements ParamConverterInterface {
/**
* A prefix for tempstore keys - empty if tempstore is not used.
*/
protected function tempstorePrefix() {
return 'views';
}
/**
* {@inheritdoc}
*/
protected function containerFor($config_entity) {
return new ViewRevisionsUI($config_entity);
}
/**
* Return the config entity name.
*
* @return string
* The config entity name.
*/
protected function configEntityName() {
return 'views';
}
/**
* {@inheritdoc}
*/
public function applies($definition, $name, Route $route) {
if (parent::applies($definition, $name, $route)) {
return (!empty($definition['tempstore']) || !empty($route
->getRequirement('revision_id'))) && $definition['type'] === 'entity:view';
}
return FALSE;
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AdminPathConfigEntityConverter:: |
protected | property | The route admin context to determine whether a route is an admin one. | |
AdminPathConfigEntityConverter:: |
protected | property | The config factory. | |
ConfigEntityRevisionsConverterBase:: |
protected | property | Stores the tempstore factory. | |
ConfigEntityRevisionsConverterBase:: |
public | function |
Converts path variables to their corresponding objects. Overrides AdminPathConfigEntityConverter:: |
|
ConfigEntityRevisionsConverterBase:: |
public | function |
Determines the entity type ID given a route definition and route defaults. Overrides DynamicEntityTypeParamConverterTrait:: |
|
ConfigEntityRevisionsConverterBase:: |
public | function |
Constructs a new converter. Overrides AdminPathConfigEntityConverter:: |
|
DeprecatedServicePropertyTrait:: |
public | function | Allows to access deprecated/removed properties. | |
EntityConverter:: |
protected | property | ||
EntityConverter:: |
protected | property | Entity repository. | |
EntityConverter:: |
protected | property | Entity type manager which performs the upcasting in the end. | |
EntityConverter:: |
protected | function | Returns the latest revision translation of the specified entity. | |
EntityConverter:: |
protected | function | Returns a language manager instance. | |
EntityConverter:: |
protected | function | Loads the specified entity revision. | |
ViewRevisionsConverter:: |
public | function |
Determines if the converter applies to a specific route and variable. Overrides AdminPathConfigEntityConverter:: |
|
ViewRevisionsConverter:: |
protected | function | Return the config entity name. | |
ViewRevisionsConverter:: |
protected | function |
Default implementation of containerFor - the container is the object. Overrides ConfigEntityRevisionsConverterBase:: |
|
ViewRevisionsConverter:: |
protected | function |
A prefix for tempstore keys - empty if tempstore is not used. Overrides ConfigEntityRevisionsConverterBase:: |