lithium\data\entity\Document::next()

public method

Returns the next Document in the set, and advances the object's internal pointer. If the end of the set is reached, a new document will be fetched from the data source connection handle ($_handle). If no more records can be fetched, returns null.

Returns

mixed

Returns the next record in the set, or null, if no more records are available.

Source

	public function next() {
		$prev = key($this->_data);
		$this->_valid = (next($this->_data) !== false);
		$cur = key($this->_data);

		if (isset($this->_removed[$cur])) {
			return $this->next();
		}
		if (!$this->_valid && $cur !== $prev && $cur !== null) {
			$this->_valid = true;
		}
		return $this->_valid ? $this->__get(key($this->_data)) : null;
	}