Ingo_Upgrade_Storage_Prefs_v4
extends Ingo_Storage_Prefs
in package
Ingo_Storage API implementation to save Ingo data via the Horde preferences system.
Table of Contents
- MAX_NONE = 1
- MAX_OK = 0
- MAX_OVER = 2
- STORE_ADD = 1
- STORE_DELETE = 2
- STORE_SORT = 4
- STORE_UPDATE = 3
- $max_rules : mixed
- $_params : array<string|int, mixed>
- Configuration parameters.
- $_rules : array<string|int, mixed>
- Rules list.
- __construct() : mixed
- __get() : mixed
- addRule() : mixed
- Adds a rule to the filters list.
- clearCache() : mixed
- Clears the internal rule cache.
- copyRule() : bool
- Creates a copy of an existing rule.
- count() : mixed
- deleteRule() : bool
- Deletes an existing rule.
- getIterator() : mixed
- getRuleByUid() : Ingo_Rule
- Returns a rule given a UID.
- getSystemRule() : Ingo_Rule
- Retrieves the specified system rule.
- maxRules() : int
- Has the maximum number of rules been reached?
- removeUserData() : mixed
- Removes the user data from the storage backend.
- sort() : mixed
- Sorts the list of rules in the given order.
- updateRule() : mixed
- Updates an existing rule.
- _getRule() : int
- Retrieves a rule.
- _load() : mixed
- _loadFromBackend() : mixed
- Load the rules from the storage backend.
- _prefs() : Horde_Prefs
- Get prefs object to use for storage.
- _removeUserData() : mixed
- Removes the user data from the storage backend.
- _store() : mixed
- Store a rule.
- _storeBackend() : mixed
- Store a rule in the backend.
Constants
MAX_NONE
public
mixed
MAX_NONE
= 1
MAX_OK
public
mixed
MAX_OK
= 0
MAX_OVER
public
mixed
MAX_OVER
= 2
STORE_ADD
public
mixed
STORE_ADD
= 1
STORE_DELETE
public
mixed
STORE_DELETE
= 2
STORE_SORT
public
mixed
STORE_SORT
= 4
STORE_UPDATE
public
mixed
STORE_UPDATE
= 3
Properties
$max_rules read-only
public
mixed
$max_rules
The value of the max_rules permission.
$_params
Configuration parameters.
protected
array<string|int, mixed>
$_params
= array()
$_rules
Rules list.
protected
array<string|int, mixed>
$_rules
= array()
Methods
__construct()
public
__construct(mixed $params) : mixed
Parameters
- $params : mixed
Return values
mixed —__get()
public
__get(mixed $name) : mixed
Parameters
- $name : mixed
Return values
mixed —addRule()
Adds a rule to the filters list.
public
addRule(Ingo_Rule $rule) : mixed
Parameters
- $rule : Ingo_Rule
-
A rule object.
Return values
mixed —clearCache()
Clears the internal rule cache.
public
clearCache() : mixed
Tags
Return values
mixed —copyRule()
Creates a copy of an existing rule.
public
copyRule(Ingo_Rule $rule) : bool
The created copy is added to the filters list after the original rule.
Parameters
- $rule : Ingo_Rule
-
The rule object to copy.
Return values
bool —True if the rule has been found and copied.
count()
public
count() : mixed
Return values
mixed —deleteRule()
Deletes an existing rule.
public
deleteRule(Ingo_Rule $rule) : bool
Parameters
- $rule : Ingo_Rule
-
A rule object.
Return values
bool —True if the rule has been found and deleted.
getIterator()
public
getIterator() : mixed
Return values
mixed —getRuleByUid()
Returns a rule given a UID.
public
getRuleByUid(string $uid) : Ingo_Rule
Parameters
- $uid : string
-
Rule UID.
Return values
Ingo_Rule —The rule object (null if not found).
getSystemRule()
Retrieves the specified system rule.
public
getSystemRule(string $rule) : Ingo_Rule
Parameters
- $rule : string
-
The rule name.
Tags
Return values
Ingo_Rule —A rule object.
maxRules()
Has the maximum number of rules been reached?
public
maxRules() : int
Return values
int —A MAX_* constant. Non-zero indicates rule cannot be added.
removeUserData()
Removes the user data from the storage backend.
public
removeUserData(string $user) : mixed
Parameters
- $user : string
-
The user name to delete filters for.
Tags
Return values
mixed —sort()
Sorts the list of rules in the given order.
public
sort(array<string|int, mixed> $rules) : mixed
Parameters
- $rules : array<string|int, mixed>
-
Sorted list of rule UIDs.
Return values
mixed —updateRule()
Updates an existing rule.
public
updateRule(Ingo_Rule $rule) : mixed
Parameters
- $rule : Ingo_Rule
-
A rule object.
Return values
mixed —_getRule()
Retrieves a rule.
protected
_getRule(Ingo_Rule $rule) : int
Parameters
- $rule : Ingo_Rule
-
The rule object.
Return values
int —The key of the rule in the rules list.
_load()
protected
_load() : mixed
Return values
mixed —_loadFromBackend()
Load the rules from the storage backend.
protected
abstract _loadFromBackend() : mixed
Return values
mixed —_prefs()
Get prefs object to use for storage.
protected
_prefs([string $user = null ]) : Horde_Prefs
Parameters
- $user : string = null
-
Username to use (if not default).
Return values
Horde_Prefs —Prefs object.
_removeUserData()
Removes the user data from the storage backend.
protected
abstract _removeUserData(string $user) : mixed
Parameters
- $user : string
-
The user name to delete filters for.
Tags
Return values
mixed —_store()
Store a rule.
protected
_store(int $action[, Ingo_Rule $rule = null ]) : mixed
Parameters
- $action : int
-
Storage action.
- $rule : Ingo_Rule = null
-
Rule the action affects.
Return values
mixed —_storeBackend()
Store a rule in the backend.
protected
abstract _storeBackend(mixed $action, mixed $rule) : mixed
Parameters
- $action : mixed
- $rule : mixed