setDescription('List all databox in Phraseanet') ->setHelp(''); return $this; } protected function doExecute(InputInterface $input, OutputInterface $output) { try { $databoxes = array_map(function (\databox $databox) { return $this->listDatabox($databox); }, $this->container->getApplicationBox()->get_databoxes()); $table = $this->getHelperSet()->get('table'); $table ->setHeaders(['id', 'name', 'alias']) ->setRows($databoxes) ->render($output); } catch (\Exception $e) { $output->writeln('Listing databox failed : '.$e->getMessage().''); } return 0; } private function listDatabox(\databox $databox) { return [ $databox->get_sbas_id(), $databox->get_dbname(), $databox->get_viewname() ]; } }