private function getBaseViewData(Host $currentHost) { $groups = array_unique(array_merge($this->getHostRepository()->getDistinctGroups(), $currentHost->getGroups())); $findBy = array('type' => Command::TYPE_SERVICE_CHECK); $commands = $this->getCommandRepository()->findBy($findBy, array('sort' => array('title' => 1))); $viewData = array(); $viewData['groups'] = $groups; $viewData['services'] = $this->getServiceRepository()->findByHost($currentHost); $viewData['commands'] = $commands; return $viewData; }
public function countByHost(Host $host) { return $this->db->selectCollection($this->getCollectionName())->count(array('hostId' => $host->getId())); }
public function export(Host $entity) { return array('id' => (string) $entity->getId(), 'name' => $entity->getName(), 'address' => $entity->getAddress(), 'editable' => $this->accessChecker->canUserManageHost($this->accessControl->getUser(), $entity)); }