// note that the default action is basic
if ($rowCount) {
$cacheKey = $this->buildPrevNextCache($sort);
- $result = $this->_query->getCachedContacts($cacheKey, $offset, $rowCount, $includeContactIds);
+ $resultSet = $this->_query->getCachedContacts($cacheKey, $offset, $rowCount, $includeContactIds)->fetchGenerator();
}
else {
- $result = $this->_query->searchQuery($offset, $rowCount, $sort, FALSE, $includeContactIds);
+ $resultSet = $this->_query->searchQuery($offset, $rowCount, $sort, FALSE, $includeContactIds)->fetchGenerator();
}
// process the result of the query
);
}
- while ($result->fetch()) {
+ foreach ($resultSet as $result) {
$row = array();
$this->_query->convertToPseudoNames($result);
// the columns we are interested in