/** * Iterates over datagrid rows. * @throws InvalidStateException * @return DibiResultIterator */ public function getRows() { if (!$this->dataSource instanceof DibiDataSource) { throw new InvalidStateException("Data source has not been set or has invalid data type. You must set data source before you want get rows."); } return $this->dataSource->getIterator(); }
/** * @return \Iterator */ public function getIterator() { if ($this->array !== NULL) { return new \ArrayIterator($this->array); } if (strspn($this->sql, '`') === 2) { return new \EmptyIterator(); } return parent::getIterator(); }