Exemple #1
0
 public function addColumn(Column $column)
 {
     $this->columns[] = $column;
     $this->idxcolumns[$column->getLabel()] = $column;
     return $this;
 }
Exemple #2
0
 protected function _getDatabasesFormatter()
 {
     $formatter = new Formatter();
     $formatter->setGraphType('1Bar1Line')->setGraphLeftAxis('nb_tables', t('Nb Tables'))->setGraphRightAxis('rows', t('Nb Rows'))->setGraphBottomAxis('db');
     $col = new Column();
     $col->mapColumn('pdb_id')->addFormat('id')->setTitle('id')->setLabel('id');
     $formatter->addColumn($col);
     $col = new Column();
     $col->setMultipleMap(array('type' => 'concat', 'pdb_db_name' => 'field', ' (' => 'str', 'pdb_identifier' => 'field', ')' => 'str'))->addFormat('check_plain')->flagInTitle(TRUE)->setTitle('Db')->setLabel('db');
     $formatter->addColumn($col);
     $col = new Column();
     $col->mapColumn('pdb_full_size')->addFormat('undo_factor100')->setTitle('Nb Tables')->setLabel('nb_tables')->addInvalidEnv('table');
     $formatter->addColumn($col);
     $col = new Column();
     $col->mapColumn('pdb_full_size')->addFormat('undo_factor100')->addFormat('human_int')->setTitle('Nb Tables')->setLabel('nb_tables_h')->setStyle('text-align: right')->flagInTooltip(TRUE);
     $formatter->addColumn($col);
     $col = new Column();
     $col->mapColumn('pdb_nb_rows')->addFormat('undo_factor100')->setLabel('rows')->setTitle('Nb Rows')->addInvalidEnv('table');
     $formatter->addColumn($col);
     $col = new Column();
     $col->mapColumn('pdb_nb_rows')->addFormat('undo_factor100')->addFormat('human_int')->setLabel('rows_h')->setStyle('text-align: right')->setTitle('Nb Rows')->flagInTooltip(TRUE)->addInvalidEnv('table');
     $formatter->addColumn($col);
     $col = new Column();
     $col->mapColumn('pdb_ugroup')->addFormat('check_plain')->setLabel('category')->setTitle('Category')->flagInTooltip(TRUE);
     $formatter->addColumn($col);
     $col = new Column();
     $col->mapColumn('pdb_timestamp')->addFormat('interval')->setLabel('timestamp')->setTitle('Last Check')->setStyle('text-align: right');
     $formatter->addColumn($col);
     return $formatter;
 }