class EntityRevisionConverter in Drupal 8
Defines a class for making sure the edit-route loads the current draft.
@internal This class only exists to provide backwards compatibility with the load_pending_revision flag, the predecessor to load_latest_revision. The core entity converter now natively loads the latest revision of an entity when the load_latest_revision flag is present. This flag is also added automatically to all entity forms.
Hierarchy
- class \Drupal\Core\ParamConverter\EntityConverter implements ParamConverterInterface uses DeprecatedServicePropertyTrait, DynamicEntityTypeParamConverterTrait
- class \Drupal\content_moderation\ParamConverter\EntityRevisionConverter
Expanded class hierarchy of EntityRevisionConverter
1 string reference to 'EntityRevisionConverter'
- content_moderation.services.yml in core/
modules/ content_moderation/ content_moderation.services.yml - core/modules/content_moderation/content_moderation.services.yml
1 service uses EntityRevisionConverter
- paramconverter.latest_revision in core/
modules/ content_moderation/ content_moderation.services.yml - Drupal\content_moderation\ParamConverter\EntityRevisionConverter
File
- core/
modules/ content_moderation/ src/ ParamConverter/ EntityRevisionConverter.php, line 17
Namespace
Drupal\content_moderation\ParamConverterView source
class EntityRevisionConverter extends EntityConverter {
/**
* {@inheritdoc}
*/
public function convert($value, $definition, $name, array $defaults) {
if (!empty($definition['load_pending_revision'])) {
@trigger_error('The load_pending_revision flag has been deprecated. You should use load_latest_revision instead.', E_USER_DEPRECATED);
$definition['load_latest_revision'] = TRUE;
}
return parent::convert($value, $definition, $name, $defaults);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DeprecatedServicePropertyTrait:: |
public | function | Allows to access deprecated/removed properties. | |
DynamicEntityTypeParamConverterTrait:: |
protected | function | Determines the entity type ID given a route definition and route defaults. | |
EntityConverter:: |
protected | property | ||
EntityConverter:: |
protected | property | Entity repository. | |
EntityConverter:: |
protected | property | Entity type manager which performs the upcasting in the end. | |
EntityConverter:: |
public | function |
Determines if the converter applies to a specific route and variable. Overrides ParamConverterInterface:: |
2 |
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. | |
EntityConverter:: |
public | function | Constructs a new EntityConverter. | 1 |
EntityRevisionConverter:: |
public | function |
Converts path variables to their corresponding objects. Overrides EntityConverter:: |