private function getOrderCriteria(array $requestedOrder = null, $qb = null)
    {
        if (!empty($requestedOrder)) {
            $orderBy = [];
            foreach ($requestedOrder as $key => $value) {
                if ('_' !== $key[0]) {
                    $key = '_' . $key;
                }

                $orderBy[$key] = $value;
            }
        } else {
            $orderBy['_position'] = 'ASC';
            if ($qb) {
                $orderBy[ $qb->getSectionAlias().'._has_children'] = 'DESC';
            }
            $orderBy['_leftnode'] = 'ASC';
        }

        return $orderBy;
    }
private function getOrderCriteria(array $requestedOrder = null, $qb = null)
    {
        if (!empty($requestedOrder)) {
            $orderBy = [];
            foreach ($requestedOrder as $key => $value) {
                if ('_' !== $key[0]) {
                    $key = '_' . $key;
                }

                $orderBy[$key] = $value;
            }
        } else {
            $orderBy['_position'] = 'ASC';
            if ($qb) {
                $orderBy[ $qb->getSectionAlias().'._has_children'] = 'DESC';
            }
            $orderBy['_leftnode'] = 'ASC';
        }

        return $orderBy;
    }
private function getOrderCriteria ( array $ requestedOrder = null , $ qb = null ) { if ( ! empty ( $ requestedOrder ) ) { $ orderBy = [ ] ; foreach ( $ requestedOrder as $ key => $ value ) { if ( '_' !== $ key [ 0 ] ) { $ key = '_' . $ key ; } $ orderBy [ $ key ] = $ value ; } } else { $ orderBy [ '_position' ] = 'ASC' ; if ( $ qb ) { $ orderBy [ $ qb -> getSectionAlias ( ) . '._has_children' ] = 'DESC' ; } $ orderBy [ '_leftnode' ] = 'ASC' ; } return $ orderBy ; }
Computes order criteria for collection.

@param  array|null $requestedOrder

@return array
Computes order criteria for collection .