You are here

public function EntityRevisionConverter::convert in Drupal 8

Converts path variables to their corresponding objects.

Parameters

mixed $value: The raw value.

mixed $definition: The parameter definition provided in the route options.

string $name: The name of the parameter.

array $defaults: The route defaults array.

Return value

mixed|null The converted parameter value.

Overrides EntityConverter::convert

File

core/modules/content_moderation/src/ParamConverter/EntityRevisionConverter.php, line 22

Class

EntityRevisionConverter
Defines a class for making sure the edit-route loads the current draft.

Namespace

Drupal\content_moderation\ParamConverter

Code

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);
}