setDescription('BETA - Get all connections report') ->addOption('type', null, InputOption::VALUE_REQUIRED, 'type of report connections, if not defined or empty it is for all connections') ->setHelp( "eg: bin/report connections:all --databox_id 2 --email 'noreply@mydomaine.com' --dmin '2022-12-01' --dmax '2023-01-01' --type 'os,nav' \n" . "\type of report\n" . "- '' or not defined all connections\n" . "- 'user' connections by user\n" . "- 'nav' connections by browser\n" . "- 'nav,version' connections by browser, version \n" . "- 'os' connections by OS \n" . "- 'os,nav' connections by OS, browser \n" . "- 'os,nav,version' connections by OS, Browser, Version\n" . "- 'res' connections by Screen Res \n" ); } public function getReport(InputInterface $input, OutputInterface $output) { $type = $input->getOption('type'); if (!empty($type) && !in_array($type, self::TYPES)) { $output->writeln("wrong '--type' option (--help for available value)"); return 1; } return (new ReportConnections( $this->findDbOr404($this->sbasId), [ 'dmin' => $this->dmin, 'dmax' => $this->dmax, 'group' => $type, 'anonymize' => $this->container['conf']->get(['registry', 'modules', 'anonymous-report']) ] )) ->setAppKey($this->container['conf']->get(['main', 'key'])); } }