feat: entity move
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
39
shared/lib/Resource/Identifier/CollectionIdentifier.php
Normal file
39
shared/lib/Resource/Identifier/CollectionIdentifier.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: Sebastian Krupinski <krupinski01@gmail.com>
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace KTXF\Resource\Identifier;
|
||||
|
||||
/**
|
||||
* Collection-level resource identifier (depth 3)
|
||||
*
|
||||
* Format: {provider}:{service}:{collection}
|
||||
*/
|
||||
class CollectionIdentifier extends ServiceIdentifier implements CollectionIdentifierInterface {
|
||||
|
||||
public function __construct(
|
||||
string $provider,
|
||||
string $service,
|
||||
private readonly string $_collection,
|
||||
) {
|
||||
parent::__construct($provider, $service);
|
||||
}
|
||||
|
||||
public function collection(): string {
|
||||
return $this->_collection;
|
||||
}
|
||||
|
||||
public function depth(): int {
|
||||
return 3;
|
||||
}
|
||||
|
||||
public function __toString(): string {
|
||||
return parent::__toString() . self::SEPARATOR . $this->_collection;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user