category OSS
package OSS_Validate
copyright Copyright (c) 2007 - 2012, Open Source Solutions Limited, Dublin, Ireland
license New BSD License

 Methods

Constructor

__construct(array $params) : void

$fieldName is required and defines the element name to match the value against in the current form / subform context.

Parameters

$params

array

Array of params containing fieldName and fieldTitle fields

Returns the field name.

getFieldName() : string

Returns

string

Returns the field title.

getFieldTitle() : int

Returns

int

Checks to see if the given $value matches the value of the given $fieldName in $context.

isValid(string $value, null | array $context) : bool

Returns true if and only if a field name has been set, the field name is available in the context, and the value of that field name matches the provided value.

Parameters

$value

string

$context

nullarray

Exceptions

\OSS_Validate_Exception

Returns

bool

Sets the field name.

setFieldName(string $fieldName) : \OSS_Validate_OSSIdenticalField

Parameters

$fieldName

string

Returns

Sets the field title.

setFieldTitle(\string:null $fieldTitle) : \OSS_Validate_OSSIdenticalField

Parameters

$fieldTitle

\string:null

Returns

 Properties

 

Name of the field as it appear in the $context array.

$_fieldName : string
 

Title of the field to display in an error message.

$_fieldTitle : string

If evaluates to null then will be set to $this->_fieldName.

 

Error message templates

$_messageTemplates : array
 

Error message variables

$_messageVariables : array

 Constants

 

FIELD_DOESNT_EXIST

FIELD_DOESNT_EXIST 
 

NOT_MATCH

NOT_MATCH 
 

NO_FIELD_NAME

NO_FIELD_NAME