src/PHPDish/Bundle/AdminBundle/Grid/Source/ORM.php
public function loadSource($columns, $page = 1, $limit = GridInterface::MAX_RESULTS_NUM)
    {
        $this->initialize();
        $qb = $this->createQueryBuilder();
        //应用过滤条件
//        $this->applyFilters($qb, $columns);
        //应用排序
        $this->applyOrders($qb, $columns);


//        dump($qb->getDQL());
        dump($qb->getQuery()->getSQL());exit;
        $adapter = new DoctrineORMAdapter($qb->getQuery());
        $pagerfanta = new Pagerfanta($adapter);
        $pagerfanta->setCurrentPage($page)->setMaxPerPage($limit);
        return $pagerfanta;
    }
public function loadSource($columns, $page = 1, $limit = GridInterface::MAX_RESULTS_NUM)
    {
        $this->initialize();
        $qb = $this->createQueryBuilder();
        //应用过滤条件
//        $this->applyFilters($qb, $columns);
        //应用排序
        $this->applyOrders($qb, $columns);


//        dump($qb->getDQL());
        dump($qb->getQuery()->getSQL());exit;
        $adapter = new DoctrineORMAdapter($qb->getQuery());
        $pagerfanta = new Pagerfanta($adapter);
        $pagerfanta->setCurrentPage($page)->setMaxPerPage($limit);
        return $pagerfanta;
    }
{@inheritdoc}