package Gems
subpackage Validate
copyright Copyright (c) 2015 Erasmus MC
license New BSD License
since Class available since version 1.7.2 Jan 12, 2016 12:28:01 PM

 Methods

Provides basic configuration for use with \Zend_Validate_Db Validators Setting $exclude allows a single record to be excluded from matching.

__construct(integer $surveyId, \Zend_Db_Adapter_Abstract $adapter = null

The KeyFields are fields that occur as names in the context of the form and that identify the current row - that can have the value. A database adapter may optionally be supplied to avoid using the registered default adapter.

Parameters

$surveyId

integer

Survey id for the current survey

$adapter

\Zend_Db_Adapter_Abstract

An optional database adapter to use.

Gets the select object to be used by the validator.

getSelect() : \Zend_Db_Select

If no select object was supplied to the constructor, then it will auto-generate one from the given table, schema, field, and adapter options.

Returns

\Zend_Db_SelectThe Select object which will be used

Returns true if and only if $value meets the validation requirements

isValid(mixed $value, array $context = array()) : boolean

If $value fails validation, then this method returns false, and getMessages() will return an array of messages that explain why the validation failed.

Parameters

$value

mixed

$context

array

Exceptions

\Zend_Validate_Exception If validation of $value is impossible

Returns

boolean

 Properties

 

Message templates

$_messageTemplates : array

Default

array(self::ERROR_NO_RECORD_FOUND => 'No record matching %value% was found.', self::ERROR_RECORD_FOUND => 'A duplicate export code matching \'%value%\' was found.')
 

Survey id

$_surveyId : integer

Default

 

Of tested survey id's

$_tested : array

Default