Merge pull request 'refactor: service interface changes' (#3) from refactor/interface-changes into main
Reviewed-on: #3
This commit was merged in pull request #3.
This commit is contained in:
@@ -192,7 +192,7 @@ class PersonalService implements ServiceBaseInterface, ServiceCollectionMutableI
|
|||||||
return new Sort($this->serviceAbilities[self::CAPABILITY_COLLECTION_LIST_SORT] ?? []);
|
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 = [];
|
$cached = [];
|
||||||
$toCheck = [];
|
$toCheck = [];
|
||||||
foreach ($identifiers as $id) {
|
foreach ($identifiers as $id) {
|
||||||
@@ -209,7 +209,7 @@ class PersonalService implements ServiceBaseInterface, ServiceCollectionMutableI
|
|||||||
return array_merge($cached, $fromStore);
|
return array_merge($cached, $fromStore);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function collectionFetch(string|int $identifier): ?CollectionResource {
|
public function collectionFetch(string|int|null $identifier): ?CollectionResource {
|
||||||
// null is root
|
// null is root
|
||||||
if ($identifier === null) {
|
if ($identifier === null) {
|
||||||
$identifier = self::ROOT_ID;
|
$identifier = self::ROOT_ID;
|
||||||
@@ -433,7 +433,7 @@ class PersonalService implements ServiceBaseInterface, ServiceCollectionMutableI
|
|||||||
return $entity;
|
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
|
// null collection is root
|
||||||
if ($collection === null) {
|
if ($collection === null) {
|
||||||
$collection = self::ROOT_ID;
|
$collection = self::ROOT_ID;
|
||||||
@@ -467,7 +467,7 @@ class PersonalService implements ServiceBaseInterface, ServiceCollectionMutableI
|
|||||||
return $result;
|
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
|
// null collection is root
|
||||||
if ($collection === null) {
|
if ($collection === null) {
|
||||||
$collection = self::ROOT_ID;
|
$collection = self::ROOT_ID;
|
||||||
@@ -493,7 +493,7 @@ class PersonalService implements ServiceBaseInterface, ServiceCollectionMutableI
|
|||||||
return $entity;
|
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
|
// null collection is root
|
||||||
if ($collection === null) {
|
if ($collection === null) {
|
||||||
$collection = self::ROOT_ID;
|
$collection = self::ROOT_ID;
|
||||||
|
|||||||
Reference in New Issue
Block a user