Code Duplication    Length = 7-7 lines in 2 locations

src/AppBundle/Controller/UserController.php 1 location

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

src/AppBundle/Controller/Settings/Divers/SubFamilyLogController.php 1 location

@@ 209-215 (lines=7) @@
206
     * @param QueryBuilder $qb
207
     * @param string       $name
208
     */
209
    protected function addQueryBuilderSort(\Doctrine\ORM\QueryBuilder $qb, $name)
210
    {
211
        $alias = current($qb->getDQLPart('from'))->getAlias();
212
        if (is_array($order = $this->getOrder($name))) {
213
            $qb->orderBy($alias . '.' . $order['field'], $order['type']);
214
        }
215
    }
216
217
    /**
218
     * Deletes a SubFamilyLog entity.