lithium\data\source\Result::peek()
Peeks at the next element in the resource without advancing Result
's cursor.
Returns
mixedThe next result (or null
if there is none).
Source
public function peek() {
if ($this->_buffer) {
return reset($this->_buffer);
}
if (!$next = $this->_fetch()) {
return null;
}
$this->_buffer[] = $next;
$first = reset($this->_buffer);
return end($first);
}