/** * Get the number of connected provider types (IdP or Sp) * for the month $timestamp * * @param Integer $timestamp * @return Array */ public function getConnectedProviderTypes($timestamp) { $date = getdate($timestamp); $searchFields = array('year' => $date['year'], 'month' => $date['mon']); $params = Surfnet_Search_Parameters::create()->setSearchParams($searchFields); $service = new ServiceRegistry_Service_JanusEntity(); $providerTypes = $service->searchCountTypes($params)->getResults(); return array('idp' => $providerTypes[0]["num"], 'sp' => $providerTypes[1]["num"]); }
public function showByTypeAction() { if ($this->getRequest()->getParam('download', false)) { $this->getResponse()->setHeader('Content-disposition', 'attachment; filename=json.txt'); } $inputFilter = $this->_helper->FilterLoader(); $params = Surfnet_Search_Parameters::create()->setLimit($inputFilter->results)->setOffset($inputFilter->startIndex)->setSortByField($inputFilter->sort)->setSortDirection($inputFilter->dir); $service = new ServiceRegistry_Service_JanusEntity(); $results = $service->searchCountTypes($params); $this->view->gridConfig = $this->_helper->gridSetup($inputFilter); $this->view->ResultSet = $results->getResults(); $this->view->startIndex = $results->getParameters()->getOffset(); $this->view->recordsReturned = $results->getResultCount(); $this->view->totalRecords = $results->getTotalCount(); }