Code Duplication    Length = 7-7 lines in 2 locations

src/AppBundle/Controller/SupplierController.php 1 location

@@ 201-207 (lines=7) @@
198
     * @param QueryBuilder $qb
199
     * @param string       $name
200
     */
201
    protected function addQueryBuilderSort(QueryBuilder $qb, $name)
202
    {
203
        $alias = current($qb->getDQLPart('from'))->getAlias();
204
        if (is_array($order = $this->getOrder($name))) {
205
            $qb->orderBy($alias . '.' . $order['field'], $order['type']);
206
        }
207
    }
208
209
    /**
210
     * Deletes a Supplier entity.

src/AppBundle/Controller/UserController.php 1 location

@@ 213-219 (lines=7) @@
210
     * @param QueryBuilder $qb
211
     * @param string       $name
212
     */
213
    protected function addQueryBuilderSort(QueryBuilder $qb, $name)
214
    {
215
        $alias = current($qb->getDQLPart('from'))->getAlias();
216
        if (is_array($order = $this->getOrder($name))) {
217
            $qb->orderBy($alias . '.' . $order['field'], $order['type']);
218
        }
219
    }
220
221
    /**
222
     * Save filters