PHP Class BaiduStore, thinksns

Author: zhujianting([email protected])
Afficher le fichier Open project: medz/thinksns-4 Class Usage Examples

Protected Properties

Свойство Type Description
$clientId
$supportedKeys array Supported variable key name.

Méthodes publiques

Méthode Description
__construct ( $clientId )
get ( string $key, mix $default = false ) : mix Get the variable value specified by the variable key name for current session user from the storage system.
remove ( string $key ) : boolean Remove the stored variable item specified by the variable key name from the storage system for current session user.
removeAll ( ) : boolean Remove all the stored variable items for current session user from the storage system.
set ( string $key, mix $value ) : boolean Save the variable item specified by the variable key name into the storage system for current session user.

Méthodes protégées

Méthode Description
getKeyForStore ( string $key ) : string Get the actual key name for current storage engine.

Method Details

__construct() public méthode

public __construct ( $clientId )

get() abstract public méthode

Get the variable value specified by the variable key name for current session user from the storage system.
abstract public get ( string $key, mix $default = false ) : mix
$key string Variable key name
$default mix Default value if the key couldn't be found
Résultat mix Returns the value for the specified key if it exists, otherwise return $default value

getKeyForStore() protected méthode

Get the actual key name for current storage engine.
protected getKeyForStore ( string $key ) : string
$key string The original key name
Résultat string

remove() abstract public méthode

Remove the stored variable item specified by the variable key name from the storage system for current session user.
abstract public remove ( string $key ) : boolean
$key string Variable key name
Résultat boolean Returns true if remove success, otherwise returns false

removeAll() abstract public méthode

Remove all the stored variable items for current session user from the storage system.
abstract public removeAll ( ) : boolean
Résultat boolean Returns true if remove success, otherwise returns false

set() abstract public méthode

Save the variable item specified by the variable key name into the storage system for current session user.
abstract public set ( string $key, mix $value ) : boolean
$key string Variable key name
$value mix Variable value
Résultat boolean Returns true if the saving operation is success, otherwise returns false

Property Details

$clientId protected_oe property

protected $clientId

$supportedKeys protected_oe static_oe property

Supported variable key name.
protected static array $supportedKeys
Résultat array