Zend Framework  3.0
Public Member Functions | List of all members
RecordExists Class Reference

Confirms a record exists in a table. More...

Public Member Functions

 isValid ($value)
 Returns true if and only if $value meets the validation requirements.
 
- Public Member Functions inherited from AbstractDb
 __construct ($options=null)
 Provides basic configuration for use with Zend Validators Setting $exclude allows a single record to be excluded from matching.
 
 getAdapter ()
 Returns the set adapter.
 
 setAdapter (DbAdapter $adapter)
 Sets a new database adapter.
 
 getExclude ()
 Returns the set exclude clause.
 
 setExclude ($exclude)
 Sets a new exclude clause.
 
 getField ()
 Returns the set field.
 
 setField ($field)
 Sets a new field.
 
 getTable ()
 Returns the set table.
 
 setTable ($table)
 Sets a new table.
 
 getSchema ()
 Returns the set schema.
 
 setSchema ($schema)
 Sets a new schema.
 
 setSelect (Select $select)
 Sets the select object to be used by the validator.
 
 getSelect ()
 Gets the select object to be used by the validator.
 
- Public Member Functions inherited from AbstractValidator
 __construct ($options=null)
 Abstract constructor for all validators A validator should accept following parameters:
 
 getOption ($option)
 Returns an option.
 
 getOptions ()
 Returns all available options.
 
 setOptions ($options=[])
 Sets one or multiple options.
 
 getMessages ()
 Returns array of validation failure messages.
 
 __invoke ($value)
 Invoke as command.
 
 getMessageVariables ()
 Returns an array of the names of variables that are used in constructing validation failure messages.
 
 getMessageTemplates ()
 Returns the message templates from the validator.
 
 setMessage ($messageString, $messageKey=null)
 Sets the validation failure message template for a particular key.
 
 setMessages (array $messages)
 Sets validation failure message templates given as an array, where the array keys are the message keys, and the array values are the message template strings.
 
 __get ($property)
 Magic function returns the value of the requested property, if and only if it is the value or a message variable.
 
 setValueObscured ($flag)
 Set flag indicating whether or not value should be obfuscated in messages.
 
 isValueObscured ()
 Retrieve flag indicating whether or not value should be obfuscated in messages.
 
 setTranslator (Translator\TranslatorInterface $translator=null, $textDomain=null)
 Set translation object.
 
 getTranslator ()
 Return translation object.
 
 hasTranslator ()
 Does this validator have its own specific translator?
 
 setTranslatorTextDomain ($textDomain= 'default')
 Set translation text domain.
 
 getTranslatorTextDomain ()
 Return the translation text domain.
 
 setTranslatorEnabled ($flag=true)
 Indicate whether or not translation should be enabled.
 
 isTranslatorEnabled ()
 Is translation enabled?
 
- Public Member Functions inherited from TranslatorAwareInterface
 setTranslator (TranslatorInterface $translator=null, $textDomain=null)
 Sets translator to use in helper.
 
- Public Member Functions inherited from AdapterAwareInterface
 setDbAdapter (Adapter $adapter)
 Set db adapter.
 

Additional Inherited Members

- Static Public Member Functions inherited from AbstractValidator
static setDefaultTranslator (Translator\TranslatorInterface $translator=null, $textDomain=null)
 Set default translation object for all validate objects.
 
static getDefaultTranslator ()
 Get default translation object for all validate objects.
 
static hasDefaultTranslator ()
 Is there a default translation object set?
 
static setDefaultTranslatorTextDomain ($textDomain= 'default')
 Set default translation text domain for all validate objects.
 
static getDefaultTranslatorTextDomain ()
 Get default translation text domain for all validate objects.
 
static getMessageLength ()
 Returns the maximum allowed message length.
 
static setMessageLength ($length=-1)
 Sets the maximum allowed message length.
 
- Public Attributes inherited from AbstractDb
const ERROR_NO_RECORD_FOUND = 'noRecordFound'
 Error constants.
 
const ERROR_RECORD_FOUND = 'recordFound'
 
- Protected Member Functions inherited from AbstractDb
 query ($value)
 Run query and returns matches, or null if no matches are found.
 
- Protected Attributes inherited from AbstractDb
 $messageTemplates
 
 $select
 
 $schema = null
 
 $table = ''
 
 $field = ''
 
 $exclude = null
 
- Static Protected Attributes inherited from AbstractValidator
static $defaultTranslator
 
static $defaultTranslatorTextDomain = 'default'
 
static $messageLength = -1
 

Detailed Description

Confirms a record exists in a table.

Member Function Documentation

isValid (   $value)

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

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

Parameters
mixed$value
Returns
bool
Exceptions
Exception\RuntimeExceptionIf validation of $value is impossible

Implements ValidatorInterface.