nextcloud/lib/public/Search/PagedProvider.php

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

56 lines
1.2 KiB
PHP
Raw Normal View History

2014-12-11 06:58:22 -05:00
<?php
2014-12-11 06:58:22 -05:00
/**
* SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
* SPDX-License-Identifier: AGPL-3.0-only
2014-12-11 06:58:22 -05:00
*/
namespace OCP\Search;
/**
* Provides a template for search functionality throughout ownCloud;
* @since 8.0.0
* @deprecated 20.0.0
2014-12-11 06:58:22 -05:00
*/
abstract class PagedProvider extends Provider {
2014-12-30 18:11:58 -05:00
/**
* show all results
* @since 8.0.0
* @deprecated 20.0.0
2014-12-30 18:11:58 -05:00
*/
public const SIZE_ALL = 0;
2014-12-30 18:11:58 -05:00
2014-12-11 06:58:22 -05:00
/**
* Constructor
* @param array $options
* @since 8.0.0
* @deprecated 20.0.0
2014-12-11 06:58:22 -05:00
*/
public function __construct($options) {
parent::__construct($options);
2014-12-11 06:58:22 -05:00
}
/**
* Search for $query
* @param string $query
* @return array An array of OCP\Search\Result's
* @since 8.0.0
* @deprecated 20.0.0
2014-12-11 06:58:22 -05:00
*/
public function search($query) {
2014-12-30 18:11:58 -05:00
// old apps might assume they get all results, so we use SIZE_ALL
return $this->searchPaged($query, 1, self::SIZE_ALL);
2014-12-11 06:58:22 -05:00
}
/**
* Search for $query
* @param string $query
* @param int $page pages start at page 1
2016-02-18 04:50:00 -05:00
* @param int $size 0 = SIZE_ALL
2014-12-11 06:58:22 -05:00
* @return array An array of OCP\Search\Result's
* @since 8.0.0
* @deprecated 20.0.0
2014-12-11 06:58:22 -05:00
*/
abstract public function searchPaged($query, $page, $size);
2014-12-11 06:58:22 -05:00
}