mirror of
https://github.com/nextcloud/server.git
synced 2026-11-14 06:32:09 +01:00
Apps register INodeAttributeProvider with the attributes they serve, in Clark notation. INodeSerializer returns nodes with those attributes in the shape @nextcloud/files uses, so PHP code gets the same file data as a PROPFIND. Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: John Molakvoæ <14975046+skjnldsv@users.noreply.github.com>
37 lines
736 B
PHP
37 lines
736 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
/**
|
|
* SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
|
*/
|
|
|
|
namespace OC\AppFramework\Bootstrap;
|
|
|
|
use NCU\Files\NodeAttributes\INodeAttributeProvider;
|
|
|
|
/**
|
|
* @psalm-immutable
|
|
* @template-extends ServiceRegistration<INodeAttributeProvider>
|
|
*/
|
|
class NodeAttributeProviderRegistration extends ServiceRegistration {
|
|
/**
|
|
* @param list<string> $attributes in Clark notation
|
|
*/
|
|
public function __construct(
|
|
string $appId,
|
|
string $service,
|
|
private array $attributes,
|
|
) {
|
|
parent::__construct($appId, $service);
|
|
}
|
|
|
|
/**
|
|
* @return list<string>
|
|
*/
|
|
public function getAttributes(): array {
|
|
return $this->attributes;
|
|
}
|
|
}
|