18 import(
'lib.pkp.classes.core.ItemIterator');
19 import(
'lib.pkp.classes.db.DAOResultIterator');
59 parent::__construct();
67 $this->records =
null;
70 $this->isFirst =
true;
77 $this->page =
$records->AbsolutePage();
78 $this->isFirst =
$records->atFirstPage();
79 $this->isLast =
$records->atLastPage();
80 $this->count =
$records->MaxRecordCount();
81 $this->pageCount =
$records->LastPageNo();
91 if ($this->records ==
null)
return false;
92 if ($this->records->Move($to))
104 if (!$this->records->EOF) {
107 $row = $this->records->getRowAssoc(
false);
108 $result =
$dao->$functionName($row, $this->functionParams);
109 if (!$this->records->MoveNext()) $this->
close();
123 $result = $this->
next();
125 assert(is_a($result,
'DataObject'));
126 $key = $result->getData($idField);
127 } elseif (empty($this->idFields)) {
130 assert(is_a($result,
'DataObject') && is_array($this->idFields));
132 foreach($this->idFields as $idField) {
133 assert(!is_null($result->getData($idField)));
134 if (!empty($key)) $key .=
'-';
135 $key .= (string)$result->getData($idField);
138 return array($key, $result);
186 if ($this->records ==
null)
return true;
187 if ($this->records->EOF) {
207 if ($this->records) {
208 $this->records->close();
209 unset($this->records);
210 $this->records =
null;
220 while (!$this->
eof()) {
240 while (!$this->
eof()) {
241 $result = $this->
next();
242 $returner[$result->getData($idField)] = $result;