protected function setAclCount(&$items, $type) { if (is_array($items)) { foreach ($items as &$item) { $item['ruleCount'] = $this->getRuleCount($type, $item['id']); } } }