Ejemplo n.º 1
0
 /**
  * looks up the URLAlias for the given url.
  *
  * @throws \eZ\Publish\API\Repository\Exceptions\NotFoundException if the path does not exist or is not valid for the given language
  *
  * @param string $url
  * @param string $languageCode
  *
  * @return \eZ\Publish\API\Repository\Values\Content\URLAlias
  */
 public function lookup($url, $languageCode = null)
 {
     $url = $this->cleanUrl($url);
     $spiUrlAlias = $this->urlAliasHandler->lookup($url);
     list($path, $languageCodes) = $this->matchPath($spiUrlAlias, $url, $languageCode);
     if ($path === false || !$this->isPathLoadable($spiUrlAlias->pathData, $languageCodes)) {
         throw new NotFoundException('URLAlias', $url);
     }
     return $this->buildUrlAliasDomainObject($spiUrlAlias, $path);
 }