Ejemplo n.º 1
0
 /**
  * Add a column type.
  *
  * @param Column $column
  *
  * @return $this
  */
 public function addColumn(Column $column)
 {
     $type = $column->getType();
     if ($this->hasColumn($type)) {
         throw new ColumnAlreadyExistsException($type);
     }
     $this->columns[$type] = $column;
     return $this;
 }
Ejemplo n.º 2
0
 /**
  * Filter Drawing override
  *
  * @param \APY\DataGridBundle\Grid\Column\Column $column
  * @param \APY\DataGridBundle\Grid\Grid $grid
  *
  * @return string
  */
 public function getGridFilter($column, $grid, $submitOnChange = true)
 {
     $id = $this->names[$grid->getHash()];
     if ($id != '' && ($this->hasBlock($block = 'grid_' . $id . '_column_' . $column->getRenderBlockId() . '_filter') || $this->hasBlock($block = 'grid_' . $id . '_column_type_' . $column->getType() . '_filter') || $this->hasBlock($block = 'grid_' . $id . '_column_filter_type_' . $column->getFilterType()) || $this->hasBlock($block = 'grid_' . $id . '_column_type_' . $column->getParentType() . '_filter')) || $this->hasBlock($block = 'grid_column_' . $column->getRenderBlockId() . '_filter') || $this->hasBlock($block = 'grid_column_type_' . $column->getType() . '_filter') || $this->hasBlock($block = 'grid_column_filter_type_' . $column->getFilterType()) || $this->hasBlock($block = 'grid_column_type_' . $column->getParentType() . '_filter')) {
         return $this->renderBlock($block, array('grid' => $grid, 'column' => $column, 'submitOnChange' => $submitOnChange && $column->isFilterSubmitOnChange()));
     }
     return '';
 }