Exemplo n.º 1
0
 /**
  * Returns all cache entries as an array.
  *
  * @return array
  */
 public function getAllEntries()
 {
     $rows = $this->_table->fetchAll();
     if ($rows->count() > 0) {
         $result = $rows->toArray();
     } else {
         $result = array();
     }
     return $result;
 }
Exemplo n.º 2
0
 /**
  * Returns a list of documents from cache.
  * @param $resultIds ids of documents for export
  * @return array Map of docId to  Document XML
  */
 private function getDocumentsFromCache($documentIds)
 {
     $documents = array();
     $documentCacheTable = new Opus_Db_DocumentXmlCache();
     $docXmlCache = $documentCacheTable->fetchAll($documentCacheTable->select()->where('document_id IN (?)', $documentIds));
     //->find($this->document->getId(), '1')->current()->xml_data;
     foreach ($docXmlCache as $row) {
         $fragment = new DomDocument();
         $fragment->loadXML($row->xml_data);
         $node = $fragment->getElementsByTagName('Opus_Document')->item(0);
         $documents[$row->document_id] = $node;
     }
     return $documents;
 }