protected function prepareRows($rows) { // Load items counter in just two queries K2Categories::countItems($rows); foreach ($rows as $row) { $row->inheritFrom = $row->getInheritFrom(); } }