mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
add SIZE_ALL const
This commit is contained in:
parent
ff1c581dcb
commit
79e790c55d
1 changed files with 8 additions and 3 deletions
|
|
@ -24,6 +24,11 @@ namespace OCP\Search;
|
|||
*/
|
||||
abstract class PagedProvider extends Provider {
|
||||
|
||||
/**
|
||||
* show all results
|
||||
*/
|
||||
const SIZE_ALL = 0;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param array $options
|
||||
|
|
@ -38,15 +43,15 @@ abstract class PagedProvider extends Provider {
|
|||
* @return array An array of OCP\Search\Result's
|
||||
*/
|
||||
public function search($query) {
|
||||
// old apps might assume they get all results, so we set size 0
|
||||
$this->searchPaged($query, 1, 0);
|
||||
// old apps might assume they get all results, so we use SIZE_ALL
|
||||
$this->searchPaged($query, 1, self::SIZE_ALL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Search for $query
|
||||
* @param string $query
|
||||
* @param int $page pages start at page 1
|
||||
* @param int $size, 0 = all
|
||||
* @param int $size, 0 = SIZE_ALL
|
||||
* @return array An array of OCP\Search\Result's
|
||||
*/
|
||||
abstract public function searchPaged($query, $page, $size);
|
||||
|
|
|
|||
Loading…
Reference in a new issue