/** * Returns global usages of all domains * * Order by date desc. * * @return GlobalUsageHistory */ public function getGlobalUsage() { $url = sprintf("%s/%s/", $this->apiUrl, self::URL_GLOBAL_USAGE); $response = $this->processQuery($url); $usages = array(); foreach ($response as $row) { $usages[] = GlobalUsageHistory::createFromArray($row); } return array_reverse($usages); }
protected function execute(InputInterface $input, OutputInterface $output) { $rage4 = $this->getRage4DNS($input->getOption('credentials')); $domainUsage = $rage4->usage->getCurrentUsage($input->getArgument('id')); $content = array(); foreach ($domainUsage as $record) { $content[] = $record->getTableRow(); } $limit = $input->getOption('limit'); if ($limit > 0) { $content = array_slice($content, 0, $limit); } $this->renderTable(GlobalUsageHistory::getTableHeaders(), $content, $output); }