You are here

protected function EntityTranslationDefaultHandler::getPathInstance in Entity Translation 7

Returns an instance of the given path.

Parameters

$path: An internal path containing the entity id wildcard.

Return value

The instantiated path.

1 call to EntityTranslationDefaultHandler::getPathInstance()
EntityTranslationDefaultHandler::initPathVariables in includes/translation.handler.inc
Initializes handler path variables based on the active path scheme.

File

includes/translation.handler.inc, line 1771
Default translation handler for the translation module.

Class

EntityTranslationDefaultHandler
Class implementing the default entity translation behaviours.

Code

protected function getPathInstance($path) {
  $path_segments = explode('/', $path);
  foreach ($path_segments as $index => $segment) {
    if ($segment == $this->pathWildcard) {
      $path_segments[$index] = $this
        ->getEntityId();
    }
    elseif ($segment[0] == '%' && isset($this->routerMap[$index])) {
      $path_segments[$index] = $this->routerMap[$index];
    }
  }
  return implode('/', $path_segments);
}