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