2017-02-02 12:19:16 -05:00
|
|
|
<?php
|
2025-06-30 09:04:05 -04:00
|
|
|
|
2026-02-09 04:53:58 -05:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
2017-02-02 12:19:16 -05:00
|
|
|
/**
|
2024-05-23 03:26:56 -04:00
|
|
|
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
2017-02-02 12:19:16 -05:00
|
|
|
*/
|
|
|
|
|
namespace OC\Files\Search;
|
|
|
|
|
|
2017-02-02 12:20:08 -05:00
|
|
|
use OCP\Files\Search\ISearchOperator;
|
|
|
|
|
use OCP\Files\Search\ISearchOrder;
|
|
|
|
|
use OCP\Files\Search\ISearchQuery;
|
2017-03-08 09:17:39 -05:00
|
|
|
use OCP\IUser;
|
2017-02-02 12:20:08 -05:00
|
|
|
|
|
|
|
|
class SearchQuery implements ISearchQuery {
|
2025-11-24 03:17:34 -05:00
|
|
|
/**
|
|
|
|
|
* @param ISearchOrder[] $order
|
|
|
|
|
*/
|
2019-11-08 09:05:21 -05:00
|
|
|
public function __construct(
|
2025-11-17 09:32:54 -05:00
|
|
|
private ISearchOperator $searchOperation,
|
|
|
|
|
private int $limit,
|
|
|
|
|
private int $offset,
|
|
|
|
|
private array $order,
|
|
|
|
|
private ?IUser $user = null,
|
|
|
|
|
private bool $limitToHome = false,
|
2019-11-08 09:05:21 -05:00
|
|
|
) {
|
2017-02-02 12:20:08 -05:00
|
|
|
}
|
|
|
|
|
|
2025-11-24 03:17:34 -05:00
|
|
|
public function getSearchOperation(): ISearchOperator {
|
2017-02-02 12:20:08 -05:00
|
|
|
return $this->searchOperation;
|
|
|
|
|
}
|
|
|
|
|
|
2025-11-24 03:17:34 -05:00
|
|
|
public function getLimit(): int {
|
2017-02-02 12:20:08 -05:00
|
|
|
return $this->limit;
|
|
|
|
|
}
|
|
|
|
|
|
2025-11-24 03:17:34 -05:00
|
|
|
public function getOffset(): int {
|
2017-02-02 12:20:08 -05:00
|
|
|
return $this->offset;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return ISearchOrder[]
|
|
|
|
|
*/
|
2025-11-24 03:17:34 -05:00
|
|
|
public function getOrder(): array {
|
2017-02-02 12:20:08 -05:00
|
|
|
return $this->order;
|
|
|
|
|
}
|
2017-03-08 09:17:39 -05:00
|
|
|
|
2025-11-24 03:17:34 -05:00
|
|
|
public function getUser(): ?IUser {
|
2017-03-08 09:17:39 -05:00
|
|
|
return $this->user;
|
|
|
|
|
}
|
2019-11-08 09:05:21 -05:00
|
|
|
|
|
|
|
|
public function limitToHome(): bool {
|
|
|
|
|
return $this->limitToHome;
|
|
|
|
|
}
|
2017-02-02 12:20:08 -05:00
|
|
|
}
|