You are here

protected function RESTServer::getControllerArguments in Services 7.3

Same name and namespace in other branches
  1. 6.3 servers/rest_server/includes/RESTServer.inc \RESTServer::getControllerArguments()

Parses controller arguments from request

Parameters

array $controller: The controller definition

Return value

void

1 call to RESTServer::getControllerArguments()
RESTServer::handle in servers/rest_server/includes/RESTServer.inc
Handles the call to the REST server

File

servers/rest_server/includes/RESTServer.inc, line 272
Class for handling REST calls.

Class

RESTServer
@file Class for handling REST calls.

Code

protected function getControllerArguments($controller) {
  $path_array = $this
    ->getCanonicalPathArray();
  array_shift($path_array);
  $data = $this
    ->parseRequestBody();
  drupal_alter('rest_server_request_parsed', $data, $controller);
  $headers = $this
    ->parseRequestHeaders();
  drupal_alter('rest_server_headers_parsed', $headers);
  $sources = array(
    'path' => $path_array,
    'param' => $this->context
      ->getGetVariable(),
    'data' => $data,
    'headers' => $headers,
  );

  // Map source data to arguments.
  return $this
    ->getControllerArgumentsFromSources($controller, $sources);
}