2022-12-02 07:06:59 -05:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
/**
|
2024-05-23 03:26:56 -04:00
|
|
|
* SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
2022-12-02 07:06:59 -05:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
namespace OCP\Collaboration\Reference;
|
|
|
|
|
|
2023-01-26 06:43:02 -05:00
|
|
|
use JsonSerializable;
|
|
|
|
|
|
2022-12-02 07:06:59 -05:00
|
|
|
/**
|
|
|
|
|
* @since 26.0.0
|
|
|
|
|
*/
|
2023-01-26 06:43:02 -05:00
|
|
|
abstract class ADiscoverableReferenceProvider implements IDiscoverableReferenceProvider, JsonSerializable {
|
2022-12-02 07:06:59 -05:00
|
|
|
/**
|
2023-01-26 16:49:48 -05:00
|
|
|
* @since 26.0.0
|
2022-12-02 07:06:59 -05:00
|
|
|
*/
|
|
|
|
|
public function jsonSerialize(): array {
|
|
|
|
|
$json = [
|
|
|
|
|
'id' => $this->getId(),
|
|
|
|
|
'title' => $this->getTitle(),
|
|
|
|
|
'icon_url' => $this->getIconUrl(),
|
|
|
|
|
'order' => $this->getOrder(),
|
|
|
|
|
];
|
|
|
|
|
if ($this instanceof ISearchableReferenceProvider) {
|
|
|
|
|
$json['search_providers_ids'] = $this->getSupportedSearchProviderIds();
|
|
|
|
|
}
|
|
|
|
|
return $json;
|
|
|
|
|
}
|
|
|
|
|
}
|