PHP Класс Ingo_Storage, horde

Автор: Jan Schneider ([email protected])
Автор: Michael Slusarz ([email protected])
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$_params array Configuration parameters.
$_rules array Rules list.

Открытые методы

Метод Описание
__construct ( array $params = [] ) Constructor.
__get ( $name )
addRule ( Ingo_Rule $rule ) Adds a rule to the filters list.
clearCache ( ) Clears the internal rule cache.
copyRule ( Ingo_Rule $rule ) : boolean Creates a copy of an existing rule.
count ( )
deleteRule ( Ingo_Rule $rule ) : boolean Deletes an existing rule.
getIterator ( )
getRuleByUid ( string $uid ) : Ingo_Rule Returns a rule given a UID.
getSystemRule ( string $rule ) : Ingo_Rule Retrieves the specified system rule.
maxRules ( ) : integer Has the maximum number of rules been reached?
removeUserData ( string $user ) Removes the user data from the storage backend.
sort ( array $rules ) Sorts the list of rules in the given order.
updateRule ( Ingo_Rule $rule ) Updates an existing rule.

Защищенные методы

Метод Описание
_getRule ( Ingo_Rule $rule ) : integer Retrieves a rule.
_load ( ) Load the rules.
_loadFromBackend ( ) Load the rules from the storage backend.
_removeUserData ( string $user ) Removes the user data from the storage backend.
_store ( integer $action, Ingo_Rule $rule = null ) Store a rule.
_storeBackend ( $action, $rule ) Store a rule in the backend.

Описание методов

__construct() публичный Метод

Constructor.
public __construct ( array $params = [] )
$params array

__get() публичный Метод

public __get ( $name )

_getRule() защищенный Метод

Retrieves a rule.
protected _getRule ( Ingo_Rule $rule ) : integer
$rule Ingo_Rule The rule object.
Результат integer The key of the rule in the rules list.

_load() защищенный Метод

Load the rules.
protected _load ( )

_loadFromBackend() абстрактный защищенный Метод

Load the rules from the storage backend.
abstract protected _loadFromBackend ( )

_removeUserData() абстрактный защищенный Метод

Removes the user data from the storage backend.
abstract protected _removeUserData ( string $user )
$user string The user name to delete filters for.

_store() защищенный Метод

Store a rule.
protected _store ( integer $action, Ingo_Rule $rule = null )
$action integer Storage action.
$rule Ingo_Rule Rule the action affects.

_storeBackend() абстрактный защищенный Метод

Store a rule in the backend.
См. также: _store()
abstract protected _storeBackend ( $action, $rule )

addRule() публичный Метод

Adds a rule to the filters list.
public addRule ( Ingo_Rule $rule )
$rule Ingo_Rule A rule object.

clearCache() публичный Метод

Clears the internal rule cache.
public clearCache ( )

copyRule() публичный Метод

The created copy is added to the filters list after the original rule.
public copyRule ( Ingo_Rule $rule ) : boolean
$rule Ingo_Rule The rule object to copy.
Результат boolean True if the rule has been found and copied.

count() публичный Метод

public count ( )

deleteRule() публичный Метод

Deletes an existing rule.
public deleteRule ( Ingo_Rule $rule ) : boolean
$rule Ingo_Rule A rule object.
Результат boolean True if the rule has been found and deleted.

getIterator() публичный Метод

public getIterator ( )

getRuleByUid() публичный Метод

Returns a rule given a UID.
public getRuleByUid ( string $uid ) : Ingo_Rule
$uid string Rule UID.
Результат Ingo_Rule The rule object (null if not found).

getSystemRule() публичный Метод

Retrieves the specified system rule.
public getSystemRule ( string $rule ) : Ingo_Rule
$rule string The rule name.
Результат Ingo_Rule A rule object.

maxRules() публичный Метод

Has the maximum number of rules been reached?
public maxRules ( ) : integer
Результат integer A MAX_* constant. Non-zero indicates rule cannot be added.

removeUserData() публичный Метод

Removes the user data from the storage backend.
public removeUserData ( string $user )
$user string The user name to delete filters for.

sort() публичный Метод

Sorts the list of rules in the given order.
public sort ( array $rules )
$rules array Sorted list of rule UIDs.

updateRule() публичный Метод

Updates an existing rule.
public updateRule ( Ingo_Rule $rule )
$rule Ingo_Rule A rule object.

Описание свойств

$_params защищенное свойство

Configuration parameters.
protected array $_params
Результат array

$_rules защищенное свойство

Rules list.
protected array $_rules
Результат array