summaryrefslogtreecommitdiffstats
path: root/lib/private/Files/Node
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2017-02-02 18:20:08 +0100
committerRobin Appelman <robin@icewind.nl>2017-03-01 14:06:39 +0100
commitdf2063ee7b49d051f9081c6fd416dd8791358ada (patch)
treea90e9f6dbae0767247593941e7c6e95b9c41befb /lib/private/Files/Node
parent706131b394eef4d346f8019b4978f9a735139b03 (diff)
downloadnextcloud-server-df2063ee7b49d051f9081c6fd416dd8791358ada.tar.gz
nextcloud-server-df2063ee7b49d051f9081c6fd416dd8791358ada.zip
Implement webdav SEARCH
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib/private/Files/Node')
-rw-r--r--lib/private/Files/Node/Folder.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/private/Files/Node/Folder.php b/lib/private/Files/Node/Folder.php
index fd907f708f3..45372d0fedf 100644
--- a/lib/private/Files/Node/Folder.php
+++ b/lib/private/Files/Node/Folder.php
@@ -33,6 +33,7 @@ use OCP\Files\FileInfo;
use OCP\Files\Mount\IMountPoint;
use OCP\Files\NotFoundException;
use OCP\Files\NotPermittedException;
+use OCP\Files\Search\ISearchOperator;
class Folder extends Node implements \OCP\Files\Folder {
/**
@@ -190,11 +191,15 @@ class Folder extends Node implements \OCP\Files\Folder {
/**
* search for files with the name matching $query
*
- * @param string $query
+ * @param string|ISearchOperator $query
* @return \OC\Files\Node\Node[]
*/
public function search($query) {
- return $this->searchCommon('search', array('%' . $query . '%'));
+ if (is_string($query)) {
+ return $this->searchCommon('search', array('%' . $query . '%'));
+ } else {
+ return $this->searchCommon('searchQuery', array($query));
+ }
}
/**