$result =
$query->
execute();
$result->
setFetchMode(\PDO::FETCH_CLASS, 'Drupal\views\ResultRow'
);
// Setup the result row objects.
$view->result =
iterator_to_array($result);
array_walk($view->result,
function DResultRow
$row,
$index) { $row->index =
$index;
});
$view->pager->
postExecute($view->result
);
$view->pager->
updatePageInfo();
$view->total_rows =
$view->pager->
getTotalItems();
// Load all entities contained in the results.
$this->
loadEntities($view->result
);
} catch (DatabaseExceptionWrapper
$e) { $view->result =
[];
if (!
empty($view->live_preview
)) { $this->messenger->
addError($e->
getMessage());
} else {