Documentation

Cache
in package
implements ArrayAccess

Cache class

Tags
category

Pop

author

Nick Sagona, III dev@nolainteractive.com

copyright

Copyright (c) 2009-2024 NOLA Interactive, LLC. (http://www.nolainteractive.com)

license

http://www.popphp.org/license New BSD License

version
4.0.0

Table of Contents

Interfaces

ArrayAccess

Properties

$adapter  : AdapterInterface|null
Cache adapter

Methods

__construct()  : mixed
Constructor
__get()  : mixed
Magic get method to return an item from cache
__isset()  : bool
Determine if the item is in cache
__set()  : void
Magic set method to save an item in the cache
__unset()  : void
Delete value from cache
adapter()  : AdapterInterface|null
Get the adapter
clear()  : void
Clear all stored values from cache
deleteItem()  : void
Delete an item in cache
deleteItems()  : void
Delete items in cache
destroy()  : void
Destroy cache resource
getAvailableAdapters()  : array<string|int, mixed>
Determine available adapters
getItem()  : mixed
Get an item from cache
getItemTtl()  : int
Get item cache TTL
getTtl()  : int
Get global cache TTL
hasItem()  : bool
Determine if the item is in cache
isAvailable()  : bool
Determine if an adapter is available
offsetExists()  : bool
ArrayAccess offsetExists
offsetGet()  : mixed
ArrayAccess offsetGet
offsetSet()  : void
ArrayAccess offsetSet
offsetUnset()  : void
ArrayAccess offsetUnset
saveItem()  : void
Save an item to cache
saveItems()  : void
Save items to cache

Properties

Methods

__get()

Magic get method to return an item from cache

public __get(string $name) : mixed
Parameters
$name : string

__isset()

Determine if the item is in cache

public __isset(string $name) : bool
Parameters
$name : string
Return values
bool

__set()

Magic set method to save an item in the cache

public __set(string $name, mixed $value) : void
Parameters
$name : string
$value : mixed

__unset()

Delete value from cache

public __unset(string $name) : void
Parameters
$name : string

clear()

Clear all stored values from cache

public clear() : void

deleteItem()

Delete an item in cache

public deleteItem(string $id) : void
Parameters
$id : string

deleteItems()

Delete items in cache

public deleteItems(array<string|int, mixed> $ids) : void
Parameters
$ids : array<string|int, mixed>

destroy()

Destroy cache resource

public destroy() : void

getAvailableAdapters()

Determine available adapters

public static getAvailableAdapters() : array<string|int, mixed>
Return values
array<string|int, mixed>

getItem()

Get an item from cache

public getItem(string $id) : mixed
Parameters
$id : string

getItemTtl()

Get item cache TTL

public getItemTtl(string $id) : int
Parameters
$id : string
Return values
int

getTtl()

Get global cache TTL

public getTtl() : int
Return values
int

hasItem()

Determine if the item is in cache

public hasItem(string $id) : bool
Parameters
$id : string
Return values
bool

isAvailable()

Determine if an adapter is available

public static isAvailable(string $adapter) : bool
Parameters
$adapter : string
Return values
bool

offsetExists()

ArrayAccess offsetExists

public offsetExists(mixed $offset) : bool
Parameters
$offset : mixed
Return values
bool

offsetGet()

ArrayAccess offsetGet

public offsetGet(mixed $offset) : mixed
Parameters
$offset : mixed

offsetSet()

ArrayAccess offsetSet

public offsetSet(mixed $offset, mixed $value) : void
Parameters
$offset : mixed
$value : mixed

offsetUnset()

ArrayAccess offsetUnset

public offsetUnset(mixed $offset) : void
Parameters
$offset : mixed

saveItem()

Save an item to cache

public saveItem(string $id, mixed $value[, int|null $ttl = null ]) : void
Parameters
$id : string
$value : mixed
$ttl : int|null = null

saveItems()

Save items to cache

public saveItems(array<string|int, mixed> $items) : void
Parameters
$items : array<string|int, mixed>

        
On this page

Search results