function ResourceType::getPath

Same name and namespace in other branches
  1. 9 core/modules/jsonapi/src/ResourceType/ResourceType.php \Drupal\jsonapi\ResourceType\ResourceType::getPath()
  2. 8.9.x core/modules/jsonapi/src/ResourceType/ResourceType.php \Drupal\jsonapi\ResourceType\ResourceType::getPath()
  3. 10 core/modules/jsonapi/src/ResourceType/ResourceType.php \Drupal\jsonapi\ResourceType\ResourceType::getPath()

Get the resource path.

Return value

string The path to access this resource type. The function replaces "--" with "/" in the URI path. Example: "node--article" -> "node/article".

See also

\Drupal\jsonapi\ResourceType\ResourceType::TYPE_NAME_URI_PATH_SEPARATOR

jsonapi.base_path

File

core/modules/jsonapi/src/ResourceType/ResourceType.php, line 442

Class

ResourceType
Value object containing all metadata for a JSON:API resource type.

Namespace

Drupal\jsonapi\ResourceType

Code

public function getPath() {
    return '/' . implode('/', explode(self::TYPE_NAME_URI_PATH_SEPARATOR, $this->typeName));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.