getResult() public method

public getResult ( Doctrine\ORM\QueryBuilder $builder, WellCommerce\Component\DataSet\Request\DataSetRequestInterface $request, WellCommerce\Component\DataSet\Column\ColumnCollection $columns, CacheOptions $cache )
$builder Doctrine\ORM\QueryBuilder
$request WellCommerce\Component\DataSet\Request\DataSetRequestInterface
$columns WellCommerce\Component\DataSet\Column\ColumnCollection
$cache WellCommerce\Component\DataSet\Cache\CacheOptions
 /**
  * {@inheritdoc}
  */
 public function getResult(QueryBuilder $builder, DataSetRequestInterface $request, ColumnCollection $columns, CacheOptions $cache)
 {
     $total = $this->paginator->getTotalRows($builder, $columns);
     $result = parent::getResult($builder, $request, $columns, $cache);
     $filtered = $request->getConditions()->count() !== 0 ? count($result) : $total;
     return ['data_id' => $this->options['data_id'], 'rows_num' => $total, 'starting_from' => $request->getOffset(), 'total' => $total, 'filtered' => $total, 'rows' => $result];
 }
示例#2
0
 /**
  * {@inheritdoc}
  */
 public function getResult(QueryBuilder $queryBuilder, DataSetRequestInterface $request, ColumnCollection $columns)
 {
     $pagination = $this->pagination->getPagination($queryBuilder, $request, $columns);
     $result = parent::getResult($queryBuilder, $request, $columns);
     $limit = $request->getLimit();
     $offset = $request->getOffset();
     return ['offset' => $offset, 'limit' => $limit, 'pagination' => $pagination, 'rows' => $result];
 }