/** * Iterator: is pointer valid? * * @return bool */ public function valid() { if (is_array($this->buffer) && isset($this->buffer[$this->position])) { return true; } if ($this->dataSource instanceof Iterator) { return $this->dataSource->valid(); } else { $key = key($this->dataSource); return $key !== null; } }
/** * Create current SiteInfo * * @return SiteInfo */ protected function createCurrentSiteInfo() { while ($this->queryResult->valid()) { $data = $this->queryResult->current(); $current = $this->createSiteInfo($data); $schema = $current->getSchema(); if (!empty($this->queriedSchemas[$schema])) { $this->queryResult->next(); } else { $this->queriedSchemas[$schema] = true; return $this->setSiteInfo($this->currentSiteInfo = $current); } } $this->currentSiteInfo = null; return null; }
/** * @return bool */ function valid() { return $this->_result->valid(); }