EnglishReferenceClasses
PersistenceEngine v1.0.0
Local storage engine: PSR-6 cache first, ORM optional.
Description: Local storage engine: PSR-6 cache first, ORM optional.
Namespace: DevCraftClub\MyShows\Persistence
Since: 1.0.0
Methods
__construct(PersistenceStoreInterface $primary, CacheKeyGenerator $keyGenerator, ?PersistenceStoreInterface $orm = null): void
| Parameter | Type | Description |
|---|---|---|
$primary | PersistenceStoreInterface | — |
$keyGenerator | CacheKeyGenerator | — |
$orm | PersistenceStoreInterface | — Default: null. |
Returns: void
find(string $type, int|string $id, callable $fetcher, ?bool $forceRecheck = null): array
Description: Find an object in local storage or load it through $fetcher.
| Parameter | Type | Description |
|---|---|---|
$type | string | — |
$id | int | string |
$fetcher | callable | — |
$forceRecheck | ?bool | — Default: null. |
Returns: array
invalidate(string $type, int|string $id): void
| Parameter | Type | Description |
|---|---|---|
$type | string | — |
$id | int | string |
Returns: void