108 $this->_table =
$config[
'table'];
109 $this->_tableClass = get_class($this->_table);
111 if (isset(
$config[
'rowClass'])) {
112 $this->_rowClass =
$config[
'rowClass'];
115 #require_once 'Zend/Loader.php'; 119 $this->_data =
$config[
'data'];
121 if (isset(
$config[
'readOnly'])) {
122 $this->_readOnly =
$config[
'readOnly'];
124 if (isset(
$config[
'stored'])) {
125 $this->_stored =
$config[
'stored'];
129 $this->_count =
count($this->_data);
141 return array(
'_data',
'_tableClass',
'_rowClass',
'_pointer',
'_count',
'_rows',
'_stored',
154 $this->_connected =
false;
199 $this->_connected =
false;
202 foreach ($this as
$row) {
204 if ($connected ==
true) {
205 $this->_connected =
true;
245 if ($this->
valid() ===
false) {
286 return $this->_pointer >= 0 && $this->_pointer <
$this->_count;
309 public function seek($position)
311 $position = (int) $position;
312 if ($position < 0 || $position >= $this->_count) {
313 #require_once 'Zend/Db/Table/Rowset/Exception.php'; 316 $this->_pointer = $position;
329 return isset($this->_data[(
int) $offset]);
341 $offset = (int) $offset;
342 if ($offset < 0 || $offset >= $this->_count) {
343 #require_once 'Zend/Db/Table/Rowset/Exception.php'; 346 $this->_pointer = $offset;
380 public function getRow($position, $seek =
false)
385 #require_once 'Zend/Db/Table/Rowset/Exception.php'; 390 $this->
seek($position);
407 foreach ($this->_rows as
$i =>
$row) {
408 $this->_data[
$i] =
$row->toArray();
415 if (!isset($this->_data[$position])) {
416 #require_once 'Zend/Db/Table/Rowset/Exception.php'; 421 if (empty($this->_rows[$position])) {
422 $this->_rows[$position] =
new $this->_rowClass(
424 'table' => $this->_table,
425 'data' => $this->_data[$position],
426 'stored' => $this->_stored,
427 'readOnly' => $this->_readOnly
432 $info = $this->_table->info();
435 if (
$info[
'cols'] == array_keys($this->_data[$position])) {
436 $this->_rows[$position]->setTable($this->
getTable());
440 $this->_rows[$position]->setTable(
null);
445 return $this->_rows[$position];
static loadClass($class, $dirs=null)
getRow($position, $seek=false)
__construct(array $config)
setTable(Zend_Db_Table_Abstract $table)
foreach( $_productCollection as $_product)() ?>" class $info
offsetSet($offset, $value)
_loadAndReturnRow($position)