lithium\data\source\Result::next()

public method

Fetches the next element from the resource.

Returns

mixed

The next result (or null if there is none).

Source

	#[ReturnTypeWillChange]
	public function next(): mixed {
		if ($this->_buffer) {
			list($this->_key, $this->_current) = array_shift($this->_buffer);
			return $this->_current;
		}

		if (!$next = $this->_fetch()) {
			$this->_key = null;
			$this->_current = null;
			$this->_valid = false;

			return null;
		} else {
			list($this->_key, $this->_current) = $next;
			$this->_valid = true;
		}
		return $this->_current;
	}