/** * formatOutput * * Format result * * @access protected * @param OutputInterface $output * @param ResultIterator $info * @return void */ protected function formatOutput(OutputInterface $output, ResultIterator $info) { $output->writeln(sprintf("Found <info>%d</info> relations in schema <info>'%s'</info>.", $info->count(), $this->schema)); $table = (new Table($output))->setHeaders(['name', 'type', 'oid ', 'comment']); foreach ($info as $table_info) { $table->addRow([sprintf("<fg=yellow>%s</fg=yellow>", $table_info['name']), $table_info['type'], $table_info['oid'], wordwrap($table_info['comment'])]); } $table->render(); }
/** * formatOutput * * Format command output from the inspector's result. * * @access protected * @param OutputInterface $output * @param ResultIterator $iterator * @return null */ protected function formatOutput(OutputInterface $output, ResultIterator $iterator) { $output->writeln(sprintf("Found <info>%d</info> schemas in database.", $iterator->count())); $table = (new Table($output))->setHeaders(['name', 'oid ', 'relations', 'comment']); foreach ($iterator as $schema_info) { $table->addRow([sprintf("<fg=yellow>%s</fg=yellow>", $schema_info['name']), $schema_info['oid'], $schema_info['relations'], wordwrap($schema_info['comment'])]); } $table->render(); }