LSYii_CompareInsensitiveValidator

Extends \CValidator

Methods

Validates the attribute of the object.

validateAttribute(\CModel $object, string $attribute) 

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

throws

if invalid operator is used

Arguments

$object

\CModel

the object being validated

$attribute

string

the attribute being validated

Properties

the constant value to be compared with

compareValue : string
var

the constant value to be compared with

Type(s)

string

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.

allowEmpty : boolean
var

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.

Type(s)

boolean

the operator for comparison. Defaults to '='. The followings are valid operators: <ul> <li>'=' or '==': validates to see if the two values are equal. If {@link strict} is true, the comparison will be done in strict mode (i.e. checking value type as well).</li> <li>'!=': validates to see if the two values are NOT equal. If {@link strict} is true, the comparison will be done in strict mode (i.e. checking value type as well).</li> </ul>

operator : string
var

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

  • '=' or '==': validates to see if the two values are equal. If {@link 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 {@link strict} is true, the comparison will be done in strict mode (i.e. checking value type as well).

Type(s)

string