public function lookup($url)
    {
        $urlHashes = array();
        foreach (explode('/', $url) as $level => $text) {
            $urlHashes[$level] = $this->getHash($text);
        }

        $pathDepth = count($urlHashes);
        if ($pathDepth > self::MAX_URL_ALIAS_DEPTH_LEVEL) {
            throw new InvalidArgumentException('$urlHashes', 'Exceeded maximum depth level of content url alias.');
        }

        $data = $this->gateway->loadUrlAliasData($urlHashes);
        if (empty($data)) {
            throw new NotFoundException('URLAlias', $url);
        }

        $hierarchyData = array();
        $isPathHistory = false;
        for ($level = 0; $level < $pathDepth; ++$level) {
            $prefix = $level === $pathDepth - 1 ? '' : 'ezurlalias_ml' . $level . '_';
            $isPathHistory = $isPathHistory ?: ($data[$prefix . 'link'] != $data[$prefix . 'id']);
            $hierarchyData[$level] = array(
                'id' => $data[$prefix . 'id'],
                'parent' => $data[$prefix . 'parent'],
                'action' => $data[$prefix . 'action'],
            );
        }

        $data['is_path_history'] = $isPathHistory;
        $data['raw_path_data'] = ($data['action_type'] == 'eznode' && !$data['is_alias'])
            ? $this->gateway->loadPathDataByHierarchy($hierarchyData)
            : $this->gateway->loadPathData($data['id']);

        return $this->mapper->extractUrlAliasFromData($data);
    }
public function lookup($url)
    {
        $urlHashes = array();
        foreach (explode('/', $url) as $level => $text) {
            $urlHashes[$level] = $this->getHash($text);
        }

        $pathDepth = count($urlHashes);
        if ($pathDepth > self::MAX_URL_ALIAS_DEPTH_LEVEL) {
            throw new InvalidArgumentException('$urlHashes', 'Exceeded maximum depth level of content url alias.');
        }

        $data = $this->gateway->loadUrlAliasData($urlHashes);
        if (empty($data)) {
            throw new NotFoundException('URLAlias', $url);
        }

        $hierarchyData = array();
        $isPathHistory = false;
        for ($level = 0; $level < $pathDepth; ++$level) {
            $prefix = $level === $pathDepth - 1 ? '' : 'ezurlalias_ml' . $level . '_';
            $isPathHistory = $isPathHistory ?: ($data[$prefix . 'link'] != $data[$prefix . 'id']);
            $hierarchyData[$level] = array(
                'id' => $data[$prefix . 'id'],
                'parent' => $data[$prefix . 'parent'],
                'action' => $data[$prefix . 'action'],
            );
        }

        $data['is_path_history'] = $isPathHistory;
        $data['raw_path_data'] = ($data['action_type'] == 'eznode' && !$data['is_alias'])
            ? $this->gateway->loadPathDataByHierarchy($hierarchyData)
            : $this->gateway->loadPathData($data['id']);

        return $this->mapper->extractUrlAliasFromData($data);
    }
public function lookup ( $ url ) { $ urlHashes = array ( ) ; foreach ( explode ( '/' , $ url ) as $ level => $ text ) { $ urlHashes [ $ level ] = $ this -> getHash ( $ text ) ; } $ pathDepth = count ( $ urlHashes ) ; if ( $ pathDepth > self :: MAX_URL_ALIAS_DEPTH_LEVEL ) { throw new InvalidArgumentException ( '$urlHashes' , 'Exceeded maximum depth level of content url alias.' ) ; } $ data = $ this -> gateway -> loadUrlAliasData ( $ urlHashes ) ; if ( empty ( $ data ) ) { throw new NotFoundException ( 'URLAlias' , $ url ) ; } $ hierarchyData = array ( ) ; $ isPathHistory = false ; for ( $ level = 0 ; $ level < $ pathDepth ; ++ $ level ) { $ prefix = $ level === $ pathDepth - 1 ? '' : 'ezurlalias_ml' . $ level . '_' ; $ isPathHistory = $ isPathHistory ? : ( $ data [ $ prefix . 'link' ] != $ data [ $ prefix . 'id' ] ) ; $ hierarchyData [ $ level ] = array ( 'id' => $ data [ $ prefix . 'id' ] , 'parent' => $ data [ $ prefix . 'parent' ] , 'action' => $ data [ $ prefix . 'action' ] , ) ; } $ data [ 'is_path_history' ] = $ isPathHistory ; $ data [ 'raw_path_data' ] = ( $ data [ 'action_type' ] == 'eznode' && ! $ data [ 'is_alias' ] ) ? $ this -> gateway -> loadPathDataByHierarchy ( $ hierarchyData ) : $ this -> gateway -> loadPathData ( $ data [ 'id' ] ) ; return $ this -> mapper -> extractUrlAliasFromData ( $ data ) ; }
Looks up a url alias for the given url.

@throws \eZ\Publish\API\Repository\Exceptions\NotFoundException
@throws \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException
@throws \eZ\Publish\API\Repository\Exceptions\BadStateException

@param string $url

@return \eZ\Publish\SPI\Persistence\Content\UrlAlias
Looks up a url alias for the given url .