You are here

protected function RESTServer::getResourceName in Services 7.3

Example. We have endpoint with path 'rest'. Request is done to url /rest/node/1.php'. Name of resource in this case is 'node'.

Return value

string

2 calls to RESTServer::getResourceName()
MockRESTServer::protectedGetResourceName in servers/rest_server/tests/rest_server_mock_classes.inc
RESTServer::getController in servers/rest_server/includes/RESTServer.inc
Controller is part of the resource like

File

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

Class

RESTServer
@file Class for handling REST calls.

Code

protected function getResourceName() {
  $canonical_path_array = $this
    ->getCanonicalPathArray();
  $resource_name = array_shift($canonical_path_array);
  return $resource_name;
}