feat: use ResourceIdentifiers

Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
2026-09-05 17:27:55 -04:00
parent 7d18bcab1a
commit e802c8fc0f
+10 -11
View File
@@ -807,19 +807,18 @@ class DefaultController extends ControllerAbstract {
private function nodeList(string $tenantId, string $userId, array $data, int $version, string $transaction): StreamedNdJsonResponse { private function nodeList(string $tenantId, string $userId, array $data, int $version, string $transaction): StreamedNdJsonResponse {
if (isset($data['sources'])) { if (!isset($data['sources'])) {
if (!is_array($data['sources'])) { throw new InvalidArgumentException(self::ERR_MISSING_SOURCES);
throw new InvalidArgumentException(self::ERR_INVALID_SOURCES); }
} if (!is_array($data['sources'])) {
throw new InvalidArgumentException(self::ERR_INVALID_SOURCES);
}
$sources = ResourceIdentifiers::fromArray($data['sources']); $sources = ResourceIdentifiers::fromArray($data['sources']);
foreach ($sources as $source) { foreach ($sources as $source) {
if (!$source instanceof ServiceIdentifier && !$source instanceof CollectionIdentifier) { if ($source instanceof EntityIdentifier || (!$source instanceof ServiceIdentifier && !$source instanceof CollectionIdentifier)) {
throw new InvalidArgumentException('Invalid parameter: sources must contain provider:service or provider:service:collection identifiers'); throw new InvalidArgumentException('Invalid parameter: sources must contain provider:service or provider:service:collection identifiers');
}
} }
} else {
$sources = null;
} }
$filter = $data['filter'] ?? null; $filter = $data['filter'] ?? null;