Constants

STORE_ADD

STORE_ADD

STORE_DELETE

STORE_DELETE

STORE_UPDATE

STORE_UPDATE

STORE_SORT

STORE_SORT

MAX_OK

MAX_OK

MAX_NONE

MAX_NONE

MAX_OVER

MAX_OVER

Properties

$max_rules

$max_rules : mixed

The value of the max_rules permission.

Type

mixed

$_params

$_params : array

Configuration parameters.

Type

array

$_rules

$_rules : array

Rules list.

Type

array

Methods

__construct()

__construct(array  $params = array()) 

Constructor.

Parameters

array $params

__get()

__get(  $name) 

Parameters

$name

getSystemRule()

getSystemRule(string  $rule) : \Ingo_Rule

Retrieves the specified system rule.

Parameters

string $rule

The rule name.

Throws

\Ingo_Exception

Returns

\Ingo_Rule

A rule object.

removeUserData()

removeUserData(string  $user) 

Removes the user data from the storage backend.

Parameters

string $user

The user name to delete filters for.

Throws

\Ingo_Exception

maxRules()

maxRules() : integer

Has the maximum number of rules been reached?

Returns

integer —

A MAX_* constant. Non-zero indicates rule cannot be added.

addRule()

addRule(\Ingo_Rule  $rule) 

Adds a rule to the filters list.

Parameters

\Ingo_Rule $rule

A rule object.

updateRule()

updateRule(\Ingo_Rule  $rule) 

Updates an existing rule.

Parameters

\Ingo_Rule $rule

A rule object.

deleteRule()

deleteRule(\Ingo_Rule  $rule) : boolean

Deletes an existing rule.

Parameters

\Ingo_Rule $rule

A rule object.

Returns

boolean —

True if the rule has been found and deleted.

copyRule()

copyRule(\Ingo_Rule  $rule) : boolean

Creates a copy of an existing rule.

The created copy is added to the filters list after the original rule.

Parameters

\Ingo_Rule $rule

The rule object to copy.

Returns

boolean —

True if the rule has been found and copied.

sort()

sort(array  $rules) 

Sorts the list of rules in the given order.

Parameters

array $rules

Sorted list of rule UIDs.

getRuleByUid()

getRuleByUid(string  $uid) : \Ingo_Rule

Returns a rule given a UID.

Parameters

string $uid

Rule UID.

Returns

\Ingo_Rule

The rule object (null if not found).

count()

count() 

getIterator()

getIterator() 

clearCache()

clearCache() 

Clears the internal rule cache.

_load()

_load() 

Load the rules.

_loadFromBackend()

_loadFromBackend() 

Load the rules from the storage backend.

_removeUserData()

_removeUserData(string  $user) 

Removes the user data from the storage backend.

Parameters

string $user

The user name to delete filters for.

Throws

\Ingo_Exception

_store()

_store(integer  $action, \Ingo_Rule  $rule = null) 

Store a rule.

Parameters

integer $action

Storage action.

\Ingo_Rule $rule

Rule the action affects.

_storeBackend()

_storeBackend(  $action,   $rule) 

Store a rule in the backend.

Parameters

$action
$rule

_getRule()

_getRule(\Ingo_Rule  $rule) : integer

Retrieves a rule.

Parameters

\Ingo_Rule $rule

The rule object.

Returns

integer —

The key of the rule in the rules list.