PHP Class Horde_HashTable_Base, horde

Author: Michael Slusarz ([email protected])
Inheritance: implements ArrayAccess, implements Serializable
Mostrar archivo Open project: horde/horde Class Usage Examples

Protected Properties

Property Type Description
$_noexist array A list of items known not to exist.
$_params array Configuration parameters.
$_persistent boolean Persistent storage provided by driver?

Public Methods

Method Description
__construct ( array $params = [] ) Constructor.
__get ( $name )
__set ( $name, $val )
clear ( ) Clear all hash table entries.
delete ( mixed $keys ) : boolean Delete a key(s).
exists ( mixed $keys ) : mixed Do the keys exists?
get ( mixed $keys ) : mixed Get data associated with a key(s).
hkey ( string $key ) : string Add local prefix to beginning of key.
offsetExists ( $offset )
offsetGet ( $offset )
offsetSet ( $offset, $value )
offsetUnset ( $offset )
serialize ( )
set ( string $key, string $val, array $opts = [] ) : boolean Set the value of a key.
unserialize ( $data )

Protected Methods

Method Description
_delete ( $keys ) : boolean Delete keys.
_exists ( array $keys ) : array Get data associated with keys.
_get ( array $keys ) : array Get data associated with keys.
_getExists ( mixed $keys, callable $callback ) : mixed Does a get/exists action on a set of keys.
_init ( ) Do initialization.
_set ( string $key, string $val, array $opts ) : boolean Set the value of a key.

Method Details

__construct() public method

Constructor.
public __construct ( array $params = [] )
$params array Configuration parameters:
  - logger: (Horde_Log_Logger) Logger object.
  - prefix: (string) Prefix to use for key storage.

__get() public method

public __get ( $name )

__set() public method

public __set ( $name, $val )

_delete() abstract protected method

Delete keys.
abstract protected _delete ( $keys ) : boolean
return boolean True on success.

_exists() abstract protected method

Get data associated with keys.
abstract protected _exists ( array $keys ) : array
$keys array An array of keys.
return array Existence check. Values are boolean true/false.

_get() abstract protected method

Get data associated with keys.
abstract protected _get ( array $keys ) : array
$keys array An array of keys.
return array The retrieved keys. Non-existent keys should return false as the value.

_getExists() protected method

Does a get/exists action on a set of keys.
protected _getExists ( mixed $keys, callable $callback ) : mixed
$keys mixed The key or an array of keys.
$callback callable The internal callback action.
return mixed The results.

_init() protected method

Do initialization.
protected _init ( )

_set() abstract protected method

Set the value of a key.
abstract protected _set ( string $key, string $val, array $opts ) : boolean
$key string The key.
$val string The string to store.
$opts array Additional options (see set()).
return boolean True on success.

clear() abstract public method

Clear all hash table entries.
abstract public clear ( )

delete() public method

Delete a key(s).
public delete ( mixed $keys ) : boolean
$keys mixed The key or an array of keys to delete.
return boolean True on success.

exists() public method

Do the keys exists?
public exists ( mixed $keys ) : mixed
$keys mixed The key or an array of keys.
return mixed A boolean/array of booleans indicating existence (return type is the type of $keys).

get() public method

Get data associated with a key(s).
public get ( mixed $keys ) : mixed
$keys mixed The key or an array of keys.
return mixed The string/array on success (return type is the type of $keys); false value(s) on failure.

hkey() public method

Add local prefix to beginning of key.
public hkey ( string $key ) : string
$key string Key name.
return string Hash table key identifier.

offsetExists() public method

public offsetExists ( $offset )

offsetGet() public method

public offsetGet ( $offset )

offsetSet() public method

public offsetSet ( $offset, $value )

offsetUnset() public method

public offsetUnset ( $offset )

serialize() public method

public serialize ( )

set() public method

Set the value of a key.
public set ( string $key, string $val, array $opts = [] ) : boolean
$key string The key.
$val string The string to store.
$opts array Additional options:
  - expire: (integer) Expiration time in seconds.
            DEFAULT: Doesn't expire.
  - replace: (boolean) Replace the value of key. If key doesn't exist,
             returns false.
             DEFAULT: false
return boolean True on success, false on error.

unserialize() public method

public unserialize ( $data )

Property Details

$_noexist protected_oe property

A list of items known not to exist.
protected array $_noexist
return array

$_params protected_oe property

Configuration parameters.
protected array $_params
return array

$_persistent protected_oe property

Persistent storage provided by driver?
protected bool $_persistent
return boolean