You are here

private function ImportEntityManager::getPathByAlias in Acquia Content Hub 8

Returns path by alias.

Since Drupal 8.8.0 the path alias core subsystem has been moved to the "path_alias" module and "path.alias_manager" marked as deprecated.

Parameters

string $alias: Alias string.

string|null $langcode: An optional language code to look up the path in.

Return value

string Path.

1 call to ImportEntityManager::getPathByAlias()
ImportEntityManager::importRemoteEntityNoDependencies in src/ImportEntityManager.php
Saves an Entity without taking care of dependencies.

File

src/ImportEntityManager.php, line 1027

Class

ImportEntityManager
Provides a service for managing imported entities' actions.

Namespace

Drupal\acquia_contenthub

Code

private function getPathByAlias($alias, $langcode = NULL) {
  $service_id = $this
    ->pathAliasMovedToSeparateModule() ? 'path_alias.manager' : 'path.alias_manager';
  return \Drupal::service($service_id)
    ->getPathByAlias($alias, $langcode);
}