class Rules extends Object implements IteratorAggregate

List of validation & condition rules.

Properties

static deprecated $defaultMessages

Methods

__construct(IControl $control)

No description

setRequired($value = TRUE)

Makes control mandatory.

bool
isRequired()

Is control mandatory?

addRule($validator, $message = NULL, $arg = NULL)

Adds a validation rule for the current control.

addCondition($validator, $arg = NULL)

Adds a validation condition and returns new branch.

addConditionOn(IControl $control, $validator, $arg = NULL)

Adds a validation condition on specified control a returns new branch.

elseCondition()

Adds a else statement.

endCondition()

Ends current validation condition.

addFilter($filter)

Adds a filter callback.

toggle($id, $hide = TRUE)

Toggles HTML element visibility.

array
getToggles($actual = FALSE)

No description

array
getToggleStates($toggles = array(), $success = TRUE)

No description

bool
validate()

Validates against ruleset.

static bool
validateRule(Rule $rule)

Validates single rule.

getIterator()

Iterates over complete ruleset.

Details

at line 37
__construct(IControl $control)

No description

Parameters

IControl $control

at line 48
Rules setRequired($value = TRUE)

Makes control mandatory.

Parameters

$value

Return Value

Rules

at line 63
bool isRequired()

Is control mandatory?

Return Value

bool

at line 76
Rules addRule($validator, $message = NULL, $arg = NULL)

Adds a validation rule for the current control.

Parameters

$validator
$message
$arg

Return Value

Rules

at line 102
Rules addCondition($validator, $arg = NULL)

Adds a validation condition and returns new branch.

Parameters

$validator
$arg

Return Value

Rules

new branch

at line 118
Rules addConditionOn(IControl $control, $validator, $arg = NULL)

Adds a validation condition on specified control a returns new branch.

Parameters

IControl $control
$validator
$arg

Return Value

Rules

new branch

at line 137
Rules elseCondition()

Adds a else statement.

Return Value

Rules

else branch

at line 152
Rules endCondition()

Ends current validation condition.

Return Value

Rules

parent branch

at line 163
Rules addFilter($filter)

Adds a filter callback.

Parameters

$filter

Return Value

Rules

at line 182
Rules toggle($id, $hide = TRUE)

Toggles HTML element visibility.

Parameters

$id
$hide

Return Value

Rules

at line 193
array getToggles($actual = FALSE)

No description

Parameters

$actual

Return Value

array

at line 203
array getToggleStates($toggles = array(), $success = TRUE)

internal  
 

No description

Parameters

$toggles
$success

Return Value

array

at line 222
bool validate()

Validates against ruleset.

Return Value

bool

at line 243
static bool validateRule(Rule $rule)

Validates single rule.

Parameters

Rule $rule

Return Value

bool

at line 258
ArrayIterator getIterator()

Iterates over complete ruleset.

Return Value

ArrayIterator