StoreInterface

Extends

StoreInterface for implementing a key-value store

Provide own Cache for performance improvements. For example saving Session between multiple calls

// cache adapter
<?php
use NextEvent\PHPSDK\Store\StoreInterface;

class MyCache implements StoreInterface
{

 public function set($key, $value)
 {
   // your implementation
 }

 public function get($key)
 {
   // your implementation
 }

 public function clear()
 {
   // your implementation
 }
}
?>

// initialize
<?php
$my_cache = new MyCache();

// on initialize
$ne_client = new \NextEvent\PHPSDK\Client($appUrl, $credentials, $widgetHash,
$my_cache);
// or
$ne_client->setCache($my_cache);
?>
package

NextEvent\PHPSDK\Store

Methods

Delete all expired records from store

clear() : void

Delete a value from the cache

delete(string $key) 

Arguments

$key

string

Clear all expired records from store

expunge() : void

Retrieve value by key from store

get(string $key) : mixed

Arguments

$key

string

Response

mixed

Determine the if value corresponding to a provided key exist

has(string $key) : boolean

Arguments

$key

string

Response

boolean

Add a value to the store under a unique key

set(string $key, mixed $value, integer $ttl = null) : void

Arguments

$key

string

$value

mixed

$ttl

integer