__construct()
__construct(int $expiry)
Construct a new datastore object.
Parameters
int | $expiry | The amount of time until values stored with this object will expire. Minimum of 30 seconds. |
This class implements a simple key/value store utilizing the database intended for storing small amounts of temporary data that must survive both the request, and the session but can have a limited lifetime.
Each entry can have up to 3 cascading keys. It features automatic deletion of expired keys.
erase(string $key1, string $key2, string $key3, string $key4)
Erase the specified data from the database
string | $key1 | |
string | $key2 |
|
string | $key3 |
|
string | $key4 |
|
store(mixed $data, string $key1, string $key2, string $key3, string $key4)
Store the specified data into the database
mixed | $data | |
string | $key1 | |
string | $key2 |
|
string | $key3 |
|
string | $key4 |
|
get(string $key1, string $key2, string $key3, string $key4) : mixed
Retrieve the specified data from the database
string | $key1 | |
string | $key2 |
|
string | $key3 |
|
string | $key4 |
|
listall(string $key1, string $key2, string $key3) : array
List all of the data matching the specified keys.
The fiewer keys specified should result in more matches.
string | $key1 | |
string | $key2 |
|
string | $key3 |
|