lithium\data\collection\RecordSet::_populate()
Implements
lithium\data\Collection::_populate()
Extracts the next item from the result resource and wraps it into a Record
object.
Returns
mixedReturns the next Record
if exists. Returns null
otherwise
Source
protected function _populate() {
if ($this->closed() || !$this->_result->valid()) {
return;
}
$data = $this->_result->current();
if ($this->_query) {
$data = $this->_mapRecord($data);
}
$result = $this->_set($data, null, ['exists' => true]);
$this->_result->next();
return $result;
}