\Constraint_comparison
Constraint_comparison Compare the value from one field to another field
Synopsis
class Constraint_comparison
extends ZenValidatorConstraint
{
- // constants
- const GREATER = 'gt';
- const GREATER_OR_EQUAL = 'gte';
- const LESS = 'lt';
- const LESS_OR_EQUAL = 'lte';
- // members
- protected $targetField;
- protected type $type;
- // Inherited members from ZenValidatorConstraint
- protected FormField $field;
- protected $customMessage;
- protected $parsleyApplied;
- // methods
- public void __construct()
- public FormField getTargetField()
- public void applyParsley()
- public void removeParsley()
- public void validate()
- public void getDefaultMessage()
- // Inherited methods from ZenValidatorConstraint
- public void __construct()
- public this setField()
- public FormField getField()
- public this setMessage()
- public string getMessage()
- public void loadExtra()
- public abstract string getDefaultMessage()
- public void applyParsley()
- public void removeParsley()
- public abstract bool validate()
- public string getConstraintName()
Hierarchy
Extends
Constants
Name | Value |
---|---|
GREATER | 'gt' |
GREATER_OR_EQUAL | 'gte' |
LESS | 'lt' |
LESS_OR_EQUAL | 'lte' |
Members
protected
- $customMessage — string
- $field — SilverStripe\Forms\FormField
- $parsleyApplied — boolean
- $targetField — string
- $type — type
Methods
public
Inherited from ZenValidatorConstraint
public
- applyParsley() — Sets the html attributes required for frontend validation Subclasses should call parent::applyParsley
- getConstraintName() — Gets the name of this constraint from it's classname which should correspond to the string that parsley uses to identify a constraint type
- getDefaultMessage() — Return the default message for this constraint
- getField()
- getMessage() — Get's the message that was set on the constrctor or falls back to default
- loadExtra() — Load extra validator
- removeParsley() — Removes the html attributes required for frontend validation Subclasses should call parent::removeParsley
- setField() — Set the field this constraint is applied to
- setMessage() — Set a custom message for this constraint
- validate() — Performs php validation on the value