Пример #1
0
 /**
  * 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();
 }
Пример #2
0
 /**
  * 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();
 }
 /**
  * slice
  *
  * see @ResultIterator
  */
 public function slice($name)
 {
     $values = [];
     foreach (parent::slice($name) as $value) {
         $values[] = $this->convertField($name, $value);
     }
     return $values;
 }
Пример #4
0
 /**
  * slice
  *
  * see @ResultIterator
  *
  * @access public
  * @param  string   $name
  * @return array
  */
 public function slice($name)
 {
     return $this->convertSlice(parent::slice($name), $name);
 }