Exemple #1
0
 function selectAllRecords()
 {
     $q = $this->query();
     $ret = array();
     while ($row = $this->db->fetchRow($q)) {
         $ret[] = $this->table->createRecord($row);
     }
     return $ret;
 }
Exemple #2
0
 /**
  * Select records on given "page"
  * @param int $pageNum page# to display, starting from 0
  * @param int $count records per page
  * @return array of Am_Record
  */
 function selectPageRecords($pageNum, $count)
 {
     if ($count <= 0) {
         throw new Am_Exception_InternalError("count could not be empty in " . __METHOD__);
     }
     $q = $this->query($pageNum * $count, $count);
     $ret = array();
     while ($row = $this->db->fetchRow($q)) {
         $ret[] = $this->table->createRecord($row);
     }
     return $ret;
 }
Exemple #3
0
 function start($tag, $attributes)
 {
     if (!$this->table) {
         return;
     }
     switch ($tag) {
         case 'row':
             $this->record = $this->table->createRecord();
             foreach ($this->record->getTable()->getFields(true) as $k) {
                 if (!empty($this->parentKeys[$k])) {
                     $this->record->set($k, $this->parentKeys[$k]);
                 }
             }
             $this->record->disableInsertPkCheck(true);
             break;
     }
 }