Exemplo n.º 1
0
 public function exportXml(XMLWriter $xml, $options = array())
 {
     $xml->startElement('table_data');
     $xml->writeAttribute('name', $this->getTable()->getName(true));
     $q = $this->query();
     while ($row = $this->db->fetchRow($q)) {
         $this->getTable()->createRecord($row)->exportXml($xml, $options);
     }
     $xml->endElement();
 }
Exemplo n.º 2
0
 /**
  * Run query with parameters @link DbSimple->select
  * and return record objects
  * @return array of Am_Record
  */
 function selectObjects($sql, $param1 = null)
 {
     $args = func_get_args();
     $q = call_user_func_array(array($this->_db, 'queryResultOnly'), $args);
     $ret = array();
     while ($row = $this->_db->fetchRow($q)) {
         $obj = new $this->_recordClass($this);
         $obj->fromRow($row);
         $ret[] = $obj;
     }
     return $ret;
 }