protected function getMetadata($urlRewrite)
    {

        // initialize the array with the metaddata
        $metadata = array();

        // try to unserialize the metadata from the passed URL rewrite
        if (isset($urlRewrite[MemberNames::METADATA])) {
            $metadata = json_decode($urlRewrite[MemberNames::METADATA], true);
        }

        // query whether or not a category ID has been found
        if (isset($metadata[UrlRewriteObserver::CATEGORY_ID])) {
            // if yes, return the metadata
            return $metadata;
        }

        // if not, append the ID of the root category
        $rootCategory = $this->getRootCategory();
        $metadata[UrlRewriteObserver::CATEGORY_ID] = (integer) $rootCategory[MemberNames::ENTITY_ID];

        // and return the metadata
        return $metadata;
    }
protected function getMetadata($urlRewrite)
    {

        // initialize the array with the metaddata
        $metadata = array();

        // try to unserialize the metadata from the passed URL rewrite
        if (isset($urlRewrite[MemberNames::METADATA])) {
            $metadata = json_decode($urlRewrite[MemberNames::METADATA], true);
        }

        // query whether or not a category ID has been found
        if (isset($metadata[UrlRewriteObserver::CATEGORY_ID])) {
            // if yes, return the metadata
            return $metadata;
        }

        // if not, append the ID of the root category
        $rootCategory = $this->getRootCategory();
        $metadata[UrlRewriteObserver::CATEGORY_ID] = (integer) $rootCategory[MemberNames::ENTITY_ID];

        // and return the metadata
        return $metadata;
    }
protected function getMetadata ( $ urlRewrite ) { // initialize the array with the metaddata $ metadata = array ( ) ; // try to unserialize the metadata from the passed URL rewrite if ( isset ( $ urlRewrite [ MemberNames :: METADATA ] ) ) { $ metadata = json_decode ( $ urlRewrite [ MemberNames :: METADATA ] , true ) ; } // query whether or not a category ID has been found if ( isset ( $ metadata [ UrlRewriteObserver :: CATEGORY_ID ] ) ) { // if yes, return the metadata return $ metadata ; } // if not, append the ID of the root category $ rootCategory = $ this -> getRootCategory ( ) ; $ metadata [ UrlRewriteObserver :: CATEGORY_ID ] = ( integer ) $ rootCategory [ MemberNames :: ENTITY_ID ] ; // and return the metadata return $ metadata ; }
Return's the unserialized metadata of the passed URL rewrite. If the
metadata doesn't contain a category ID, the category ID of the root
category will be added.

@param array $urlRewrite The URL rewrite to return the metadata for

@return array The metadata of the passed URL rewrite
Return s the unserialized metadata of the passed URL rewrite . If the metadata doesn t contain a category ID the category ID of the root category will be added .