You are here

protected function RequestHandler::getLegacyParameters in Drupal 8

Provides the parameter usable without an argument resolver.

This creates an list of parameters in a statically defined order.

Parameters

\Drupal\Core\Routing\RouteMatchInterface $route_match: The route match

mixed $unserialized: The unserialized data.

\Symfony\Component\HttpFoundation\Request $request: The request.

Return value

array An array of parameters.

Deprecated

in drupal:8.4.0 and is removed from drupal:9.0.0. Use the argument resolver method instead, see ::createArgumentResolver().

See also

https://www.drupal.org/node/2894819

1 call to RequestHandler::getLegacyParameters()
RequestHandler::delegateToRestResourcePlugin in core/modules/rest/src/RequestHandler.php
Delegates an incoming request to the appropriate REST resource plugin.

File

core/modules/rest/src/RequestHandler.php, line 334

Class

RequestHandler
Acts as intermediate request forwarder for resource plugins.

Namespace

Drupal\rest

Code

protected function getLegacyParameters(RouteMatchInterface $route_match, $unserialized, Request $request) {
  $route_parameters = $route_match
    ->getParameters();
  $parameters = [];

  // Filter out all internal parameters starting with "_".
  foreach ($route_parameters as $key => $parameter) {
    if (substr((string) $key, 0, 1) !== '_') {
      $parameters[] = $parameter;
    }
  }
  return array_merge($parameters, [
    $unserialized,
    $request,
  ]);
}