示例#1
0
 /**
  * {@inheritdoc}
  */
 public function buildGrid(GridBuilder $builder, array $options = array())
 {
     $builder->setRoute($options['route'])->setRouteParameters($options['route_parameters'])->setPersistence($options['persistence'])->setPage($options['page'])->setMaxResults($options['max_results'])->setMaxPerPage($options['max_per_page'])->setFilterable($options['filterable'])->setSortable($options['sortable'])->setSortBy($options['sort_by'])->setOrder($options['order'])->setGroupBy($options['group_by']);
     if (!empty($options['source'])) {
         $builder->setSource($options['source']);
     }
 }
 /**
  * {@inheritdoc}
  */
 public function createBuilder($type = 'grid', Source $source = null, array $options = array())
 {
     $type = $this->resolveType($type);
     $options = $this->resolveOptions($type, $source, $options);
     $builder = new GridBuilder($this->container, $this, $type->getName(), $options);
     $builder->setType($type);
     $type->buildGrid($builder, $options);
     return $builder;
 }
 public function testGetGrid()
 {
     $this->assertInstanceOf('APY\\DataGridBundle\\Grid\\Grid', $this->builder->getGrid());
 }