PHP Class Horde_HashTable_Base, horde

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

Protected Properties

Свойство Type Description
$_noexist array A list of items known not to exist.
$_params array Configuration parameters.
$_persistent boolean Persistent storage provided by driver?

Méthodes publiques

Méthode 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 )

Méthodes protégées

Méthode 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 méthode

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 méthode

public __get ( $name )

__set() public méthode

public __set ( $name, $val )

_delete() abstract protected méthode

Delete keys.
abstract protected _delete ( $keys ) : boolean
Résultat boolean True on success.

_exists() abstract protected méthode

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

_get() abstract protected méthode

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

_getExists() protected méthode

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.
Résultat mixed The results.

_init() protected méthode

Do initialization.
protected _init ( )

_set() abstract protected méthode

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()).
Résultat boolean True on success.

clear() abstract public méthode

Clear all hash table entries.
abstract public clear ( )

delete() public méthode

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

exists() public méthode

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

get() public méthode

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

hkey() public méthode

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

offsetExists() public méthode

public offsetExists ( $offset )

offsetGet() public méthode

public offsetGet ( $offset )

offsetSet() public méthode

public offsetSet ( $offset, $value )

offsetUnset() public méthode

public offsetUnset ( $offset )

serialize() public méthode

public serialize ( )

set() public méthode

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
Résultat boolean True on success, false on error.

unserialize() public méthode

public unserialize ( $data )

Property Details

$_noexist protected_oe property

A list of items known not to exist.
protected array $_noexist
Résultat array

$_params protected_oe property

Configuration parameters.
protected array $_params
Résultat array

$_persistent protected_oe property

Persistent storage provided by driver?
protected bool $_persistent
Résultat boolean