src/Micrometa/Infrastructure/Parser/JsonLD/VocabularyCache.php
public function setDocument($url, RemoteDocument $document)
    {
        // Process the context
        if (isset($document->document->{'@context'}) && is_object($document->document->{'@context'})) {
            $this->processContext((array)$document->document->{'@context'});
        }

        // Save the document to the cache
        $docUrlHash     = $this->getCacheHash($url, self::SLOT_DOC);
        $cachedDocument = Cache::getAdapter()->getItem($docUrlHash);
        $cachedDocument->set($document);
        Cache::getAdapter()->save($cachedDocument);

        // Return the document
        return $document;
    }
public function setDocument($url, RemoteDocument $document)
    {
        // Process the context
        if (isset($document->document->{'@context'}) && is_object($document->document->{'@context'})) {
            $this->processContext((array)$document->document->{'@context'});
        }

        // Save the document to the cache
        $docUrlHash     = $this->getCacheHash($url, self::SLOT_DOC);
        $cachedDocument = Cache::getAdapter()->getItem($docUrlHash);
        $cachedDocument->set($document);
        Cache::getAdapter()->save($cachedDocument);

        // Return the document
        return $document;
    }
public function setDocument ( $ url , RemoteDocument $ document ) { // Process the context if ( isset ( $ document -> document -> { '@context' } ) && is_object ( $ document -> document -> { '@context' } ) ) { $ this -> processContext ( ( array ) $ document -> document -> { '@context' } ) ; } // Save the document to the cache $ docUrlHash = $ this -> getCacheHash ( $ url , self :: SLOT_DOC ) ; $ cachedDocument = Cache :: getAdapter ( ) -> getItem ( $ docUrlHash ) ; $ cachedDocument -> set ( $ document ) ; Cache :: getAdapter ( ) -> save ( $ cachedDocument ) ; // Return the document return $ document ; }
Cache a document

@param string $url              URL
@param RemoteDocument $document Document

@return RemoteDocument Document
Cache a document