EntityRevisionParamConverter

Parameter converter for upcasting entity revision IDs to full objects.

This is useful for pages which want to show a specific revision, like "/entity_example/{entity_example}/revision/{entity_example_revision}".

In order to use it you should specify some additional options in your route:

example.route:
  path: /foo/{entity_example_revision}
  options:
    parameters:
      entity_example_revision:
        type: entity_revision:entity_example

Hierarchy

File

core/lib/Drupal/Core/ParamConverter/EntityRevisionParamConverter.php, line 26

Namespace

Drupal\Core\ParamConverter

Members

Name Modifiers Type Description
EntityRevisionParamConverter::$entityRepository protected property The entity repository.
EntityRevisionParamConverter::$entityTypeManager protected property The entity type manager.
EntityRevisionParamConverter::applies public function Determines if the converter applies to a specific route and variable. Overrides ParamConverterInterface::applies
EntityRevisionParamConverter::convert public function Converts path variables to their corresponding objects. Overrides ParamConverterInterface::convert
EntityRevisionParamConverter::__construct public function Creates a new EntityRevisionParamConverter instance.
doc_Drupal
2016-10-29 09:07:30
Comments
Leave a Comment

Please login to continue.