You are here

public function ResourceManager::getResourceIdFromRequest in RESTful 7.2

Get the resource name for the current request.

Return value

string The resource ID.

Overrides ResourceManagerInterface::getResourceIdFromRequest

File

src/Resource/ResourceManager.php, line 124
Contains \Drupal\restful\Resource\ResourceManager.

Class

ResourceManager

Namespace

Drupal\restful\Resource

Code

public function getResourceIdFromRequest() {
  $resource_name =& drupal_static(__METHOD__);
  if (isset($resource_name)) {
    return $resource_name;
  }
  $path = $this->request
    ->getPath(FALSE);
  list($resource_name, ) = static::getPageArguments($path);
  return $resource_name;
}