summaryrefslogtreecommitdiffstats
path: root/lib/private/Files/Cache/QuerySearchHelper.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/Files/Cache/QuerySearchHelper.php')
-rw-r--r--lib/private/Files/Cache/QuerySearchHelper.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/private/Files/Cache/QuerySearchHelper.php b/lib/private/Files/Cache/QuerySearchHelper.php
index 7d8098f0efa..2d20da72f51 100644
--- a/lib/private/Files/Cache/QuerySearchHelper.php
+++ b/lib/private/Files/Cache/QuerySearchHelper.php
@@ -26,6 +26,7 @@ use OCP\Files\IMimeTypeLoader;
use OCP\Files\Search\ISearchBinaryOperator;
use OCP\Files\Search\ISearchComparison;
use OCP\Files\Search\ISearchOperator;
+use OCP\Files\Search\ISearchOrder;
/**
* Tools for transforming search queries into database queries
@@ -185,4 +186,14 @@ class QuerySearchHelper {
}
return $builder->createNamedParameter($value, $type);
}
+
+ /**
+ * @param IQueryBuilder $query
+ * @param ISearchOrder[] $orders
+ */
+ public function addSearchOrdersToQuery(IQueryBuilder $query, array $orders) {
+ foreach ($orders as $order) {
+ $query->addOrderBy($order->getField(), $order->getDirection());
+ }
+ }
}