public function decomposeURI($uri, &$type = null)
    {
        $elements = [];

        if (!self::URIIsCandidate($uri)) {
            return $elements;
        }

        foreach ($this->getURIPatterns() as $name => $pattern) {
            if (preg_match($pattern, $uri, $matches)) {
                $type = $name;
                $elements = [
                    'type'  => $matches['type'],
                    'id'    => $matches['id'],
                ];
                break;
            }
        }

        return $elements;
    }
public function decomposeURI($uri, &$type = null)
    {
        $elements = [];

        if (!self::URIIsCandidate($uri)) {
            return $elements;
        }

        foreach ($this->getURIPatterns() as $name => $pattern) {
            if (preg_match($pattern, $uri, $matches)) {
                $type = $name;
                $elements = [
                    'type'  => $matches['type'],
                    'id'    => $matches['id'],
                ];
                break;
            }
        }

        return $elements;
    }
public function decomposeURI ( $ uri , & $ type = null ) { $ elements = [ ] ; if ( ! self :: URIIsCandidate ( $ uri ) ) { return $ elements ; } foreach ( $ this -> getURIPatterns ( ) as $ name => $ pattern ) { if ( preg_match ( $ pattern , $ uri , $ matches ) ) { $ type = $ name ; $ elements = [ 'type' => $ matches [ 'type' ] , 'id' => $ matches [ 'id' ] , ] ; break ; } } return $ elements ; }
Extract entity type and id from the given URI.

@param string $uri
@param string $type
The type of the URI will be passed on to you through this argument.

@return string[]
Extract entity type and id from the given URI .