LimeSurvey API - Master branch

LSYii_CompareInsensitiveValidator extends CValidator
in package

Table of Contents

Properties

$allowEmpty  : bool
$compareValue  : string
$operator  : string

Methods

validateAttribute()  : mixed
Validates the attribute of the object.

Properties

$allowEmpty

public bool $allowEmpty = \false

whether the attribute value can be null or empty. Defaults to false. If this is true, it means the attribute is considered valid when it is empty.

$operator

public string $operator = '='

the operator for comparison. Defaults to '='. The following are valid operators:

  • '=' or '==': validates to see if the two values are equal. If [](strict) is true, the comparison will be done in strict mode (i.e. checking value type as well).
  • '!=': validates to see if the two values are NOT equal. If [](strict) is true, the comparison will be done in strict mode (i.e. checking value type as well).

Methods

validateAttribute()

Validates the attribute of the object.

protected validateAttribute(CModel $object, string $attribute) : mixed

If there is any error, the error message is added to the object.

Parameters
$object : CModel

the object being validated

$attribute : string

the attribute being validated

Tags
throws
CException

if invalid operator is used


        
On this page

Search results