Пример #1
0
 /**
  * Convert an array into an Zend_Db_Xml_XmlContent object
  * 
  * @param array $xmlRow
  * 
  * @return Zend_Db_Xml_XmlContent
  */
 public static function getXmlResult($xmlRow)
 {
     $xmlResult = new Zend_Db_Xml_XmlContent();
     $xmlResult->setId($xmlRow['ID']);
     $dbxml = $xmlRow['DATA'];
     if (is_null($dbxml)) {
         $domdoc = null;
     } else {
         $domdoc = new DOMDocument();
         $domdoc->loadXML($xmlRow['DATA']);
     }
     Zend_Db_Xml_XmlUtil::setDOM($xmlResult, Zend_Db_Xml_XmlUtil::DATA, $domdoc);
     $about = $xmlRow['ABOUT'];
     if (!is_null($about)) {
         $domAbt = new DOMDocument();
         $domAbt->loadXML($about);
         Zend_Db_Xml_XmlUtil::setDOM($xmlResult, Zend_Db_Xml_XmlUtil::ABOUT, $domAbt);
     }
     $attachment = $xmlRow['ATTACHMENT'];
     if (!is_null($attachment)) {
         $xmlResult->attachment = $attachment;
     }
     return $xmlResult;
 }
Пример #2
0
 /**
  * Helper function to return list
  * of documents
  *
  * @param array $dbresults of rows
  * @return Zend_Db_Xml_XmlIterator
  */
 private function processList($dbresults)
 {
     $results = new Zend_Db_Xml_XmlIterator();
     foreach ($dbresults as $currRow) {
         $curr = Zend_Db_Xml_XmlUtil::getXmlResult($currRow);
         $results->add($curr);
     }
     return $results;
 }