FetchAll.php 686 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php

namespace ImportData\V1\Query\Provider;

use Doctrine\ORM\QueryBuilder;
use ZF\Apigility\Doctrine\Server\Query\Provider\DefaultOrm;
use ZF\Rest\ResourceEvent;

class FetchAll extends DefaultOrm
{
    /**
     * @param ResourceEvent $event
     * @param string        $entityClass
     * @param array         $parameters
     * @return QueryBuilder
     */
    public function createQuery(ResourceEvent $event, $entityClass, $parameters)
    {
        /** @var QueryBuilder $qb */
        $qb = parent::createQuery($event, $entityClass, $parameters);

22
        $qb->orderBy('row.id', 'asc'); // indispensable car les données sont demandées paginées
23
24
25

        return $qb;
    }
26
}