public static function appendOrder(QueryBuilder $queryBuilder, DataTablesWrapperInterface $dtWrapper) {

        foreach ($dtWrapper->getRequest()->getOrder() as $dtOrder) {

            $dtColumn = array_values($dtWrapper->getColumns())[$dtOrder->getColumn()];
            if (false === $dtColumn->getOrderable()) {
                continue;
            }

            $queryBuilder->addOrderBy($dtColumn->getMapping()->getAlias(), $dtOrder->getDir());
        }
    }
public static function appendOrder(QueryBuilder $queryBuilder, DataTablesWrapperInterface $dtWrapper) {

        foreach ($dtWrapper->getRequest()->getOrder() as $dtOrder) {

            $dtColumn = array_values($dtWrapper->getColumns())[$dtOrder->getColumn()];
            if (false === $dtColumn->getOrderable()) {
                continue;
            }

            $queryBuilder->addOrderBy($dtColumn->getMapping()->getAlias(), $dtOrder->getDir());
        }
    }
public static function appendOrder ( QueryBuilder $ queryBuilder , DataTablesWrapperInterface $ dtWrapper ) { foreach ( $ dtWrapper -> getRequest ( ) -> getOrder ( ) as $ dtOrder ) { $ dtColumn = array_values ( $ dtWrapper -> getColumns ( ) ) [ $ dtOrder -> getColumn ( ) ] ; if ( false === $ dtColumn -> getOrderable ( ) ) { continue ; } $ queryBuilder -> addOrderBy ( $ dtColumn -> getMapping ( ) -> getAlias ( ) , $ dtOrder -> getDir ( ) ) ; } }
Append an ORDER clause.

@param QueryBuilder $queryBuilder The query builder.
@param DataTablesWrapperInterface $dtWrapper The wrapper.
@return void
Append an ORDER clause .