Exemplo n.º 1
0
 public function buildView(TableView $view, TableInterface $table)
 {
     $data = array();
     foreach ($table->getData()->getRows() as $_data) {
         $row = $this->resolveParams($table->getOption('rows_params'), $_data, true);
         $data['row_' . implode('_', $row)] = $row;
     }
     $view->setData($data);
 }
Exemplo n.º 2
0
 private function extractConfig(TableInterface $table, array $data = null, array $options = array())
 {
     $data = array('id' => $table->getOption('name'), 'name' => $table->getOption('name'), 'type' => $table->getType()->getName(), 'type_class' => get_class($table->getType()), 'passed_options' => array(), 'resolved_options' => array(), 'columns' => array());
     foreach ($table->getOptions() as $option => $value) {
         if (substr($option, 0, 1) !== '_') {
             $data['resolved_options'][$option] = $this->valueExporter->exportValue($value);
         }
     }
     foreach ($options['_passed_options'] as $option => $value) {
         $data['passed_options'][$option] = $this->valueExporter->exportValue($value);
     }
     ksort($data['passed_options']);
     ksort($data['resolved_options']);
     /* @var $column \EMC\TableBundle\Table\Column\ColumnInterface */
     $column = null;
     foreach ($table->getColumns() as $column) {
         $data['columns'][$column->getOption('name')] = $this->extractColumnConfig($column);
     }
     return $data;
 }
Exemplo n.º 3
0
 /**
  * @expectedException \InvalidArgumentException
  */
 public function testGetOptionException()
 {
     $this->table->getOption('c');
 }