You are here

public function DataProviderEntity::canonicalPath in RESTful 7.2

Generates the canonical path for a given path.

Parameters

string $path: The aliased path.

Return value

string The canonical path.

Overrides DataProvider::canonicalPath

1 call to DataProviderEntity::canonicalPath()
DataProviderEntity::getCacheFragments in src/Plugin/resource/DataProvider/DataProviderEntity.php
Gets the entity context.

File

src/Plugin/resource/DataProvider/DataProviderEntity.php, line 334
Contains \Drupal\restful\Plugin\resource\DataProvider\DataProviderEntity.

Class

DataProviderEntity
Class DataProviderEntity.

Namespace

Drupal\restful\Plugin\resource\DataProvider

Code

public function canonicalPath($path) {
  $ids = explode(Resource::IDS_SEPARATOR, $path);
  $canonical_ids = array_map(array(
    $this,
    'getEntityIdByFieldId',
  ), $ids);
  return implode(Resource::IDS_SEPARATOR, $canonical_ids);
}