本文整理匯總了PHP中eZ\Publish\API\Repository\Repository::getURLAliasService方法的典型用法代碼示例。如果您正苦於以下問題:PHP Repository::getURLAliasService方法的具體用法?PHP Repository::getURLAliasService怎麽用?PHP Repository::getURLAliasService使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類eZ\Publish\API\Repository\Repository
的用法示例。
在下文中一共展示了Repository::getURLAliasService方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getURLAliasService
/**
* Get URLAliasService
*
* @return \eZ\Publish\API\Repository\URLAliasService
*/
public function getURLAliasService()
{
if ($this->urlAliasService !== null) {
return $this->urlAliasService;
}
$this->urlAliasService = new URLAliasService($this->repository->getURLAliasService(), $this->signalDispatcher);
return $this->urlAliasService;
}
示例2: castLocation
public function castLocation(Location $location, array $a, Stub $stub, $isNested, $filter = 0)
{
$urlAliasService = $this->repository->getURLAliasService();
$prefix = Caster::PREFIX_PROTECTED;
if (!isset($a[$prefix . 'id'])) {
$b = (array) $location;
if (isset($b[$prefix . 'id'])) {
$a += [$prefix . 'id' => $b[$prefix . 'id']];
}
}
if ($filter & Caster::EXCLUDE_VERBOSE) {
$a[Caster::PREFIX_VIRTUAL . 'urlAlias'] = $urlAliasService->reverseLookup($location);
} else {
$urlAliases = array_merge($urlAliasService->listLocationAliases($location, false), $urlAliasService->listLocationAliases($location, true));
$locationPaths = [];
foreach ($urlAliases as $alias) {
$locationPaths[] = $alias->path;
}
$a[Caster::PREFIX_VIRTUAL . 'urlAliases'] = $locationPaths;
}
return $a;
}