You are here

public function ConfigurableResourceType::getPath in JSON:API Extras 8

Same name and namespace in other branches
  1. 8.3 src/ResourceType/ConfigurableResourceType.php \Drupal\jsonapi_extras\ResourceType\ConfigurableResourceType::getPath()
  2. 8.2 src/ResourceType/ConfigurableResourceType.php \Drupal\jsonapi_extras\ResourceType\ConfigurableResourceType::getPath()

Get the resource path.

Return value

string The path to access this resource type. Default: /entity_type_id/bundle.

Overrides ResourceType::getPath

See also

jsonapi.base_path

File

src/ResourceType/ConfigurableResourceType.php, line 117

Class

ConfigurableResourceType
Defines a configurable resource type.

Namespace

Drupal\jsonapi_extras\ResourceType

Code

public function getPath() {
  $resource_config = $this
    ->getJsonapiResourceConfig();
  if (!$resource_config) {
    return parent::getPath();
  }
  $config_path = $resource_config
    ->get('path');
  if (!$config_path) {
    return parent::getPath();
  }
  return $config_path;
}