refactor: service interface changes #3
@@ -192,7 +192,7 @@ class PersonalService implements ServiceBaseInterface, ServiceCollectionMutableI
|
||||
return new Sort($this->serviceAbilities[self::CAPABILITY_COLLECTION_LIST_SORT] ?? []);
|
||||
}
|
||||
|
||||
public function collectionExtant(string|int $location, string|int ...$identifiers): array {
|
||||
public function collectionExtant(string|int|null $location, string|int ...$identifiers): array {
|
||||
$cached = [];
|
||||
$toCheck = [];
|
||||
foreach ($identifiers as $id) {
|
||||
@@ -209,7 +209,7 @@ class PersonalService implements ServiceBaseInterface, ServiceCollectionMutableI
|
||||
return array_merge($cached, $fromStore);
|
||||
}
|
||||
|
||||
public function collectionFetch(string|int $identifier): ?CollectionResource {
|
||||
public function collectionFetch(string|int|null $identifier): ?CollectionResource {
|
||||
// null is root
|
||||
if ($identifier === null) {
|
||||
$identifier = self::ROOT_ID;
|
||||
@@ -433,7 +433,7 @@ class PersonalService implements ServiceBaseInterface, ServiceCollectionMutableI
|
||||
return $entity;
|
||||
}
|
||||
|
||||
public function entityCreate(string|int $collection, EntityMutableInterface $entity, array $options = []): EntityResource {
|
||||
public function entityCreate(string|int|null $collection, EntityMutableInterface $entity, array $options = []): EntityResource {
|
||||
// null collection is root
|
||||
if ($collection === null) {
|
||||
$collection = self::ROOT_ID;
|
||||
@@ -467,7 +467,7 @@ class PersonalService implements ServiceBaseInterface, ServiceCollectionMutableI
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function entityDelete(string|int $collection, string|int $identifier): EntityResource {
|
||||
public function entityDelete(string|int|null $collection, string|int $identifier): EntityResource {
|
||||
// null collection is root
|
||||
if ($collection === null) {
|
||||
$collection = self::ROOT_ID;
|
||||
@@ -493,7 +493,7 @@ class PersonalService implements ServiceBaseInterface, ServiceCollectionMutableI
|
||||
return $entity;
|
||||
}
|
||||
|
||||
public function entityDelta(string|int $collection, string $signature, string $detail = 'ids'): Delta {
|
||||
public function entityDelta(string|int|null $collection, string $signature, string $detail = 'ids'): Delta {
|
||||
// null collection is root
|
||||
if ($collection === null) {
|
||||
$collection = self::ROOT_ID;
|
||||
|
||||
Reference in New Issue
Block a user