function selectAllRecords() { $q = $this->query(); $ret = array(); while ($row = $this->db->fetchRow($q)) { $ret[] = $this->table->createRecord($row); } return $ret; }
/** * 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; }
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; } }