Confirms a record does not exist in a table.

category Zend
package Zend_Validate
uses
copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
license New BSD License
inherited_from \Zend_Validate_Db_Abstract

 Methods

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

__construct(array|\Zend_Config $options) 
Inherited

Exclude can either be a String containing a where clause, or an array with field and value keys to define the where clause added to the sql. A database adapter may optionally be supplied to avoid using the registered default adapter.

The following option keys are supported: 'table' => The database table to validate against 'schema' => The schema keys 'field' => The field to check for a match 'exclude' => An optional where clause or field/value pair to exclude from the query 'adapter' => An optional database adapter to use

Parameters

$options

array\Zend_Config

Options to use for this validator

Exceptions

\Zend_Validate_Exception

Magic function returns the value of the requested property, if and only if it is the value or a message variable.

__get(string $property) : mixed
Inherited

Parameters

$property

string

Exceptions

\Zend_Validate_Exception

Returns

mixed

Returns the set adapter

getAdapter() : \Zend_Db_Adapter
Inherited

Exceptions

\Zend_Validate_Exception

Returns

\Zend_Db_Adapter

Get default translation object for all validate objects

getDefaultTranslator() : \Zend_Translate_Adapter | null
InheritedStatic

Returns

\Zend_Translate_Adapternull

Returns array of validation failure message codes

getErrors() : array
Inherited
deprecated Since 1.5.0

Returns

array

Returns the set exclude clause

getExclude() : string | array
Inherited

Returns

stringarray

Returns the set field

getField() : string | array
Inherited

Returns

stringarray

Returns the maximum allowed message length

getMessageLength() : integer
InheritedStatic

Returns

integer

Returns the message templates from the validator

getMessageTemplates() : array
Inherited

Returns

array

Returns an array of the names of variables that are used in constructing validation failure messages

getMessageVariables() : array
Inherited

Returns

array

Returns array of validation failure messages

getMessages() : array
Inherited

If isValid() was never called or if the most recent isValid() call returned true, then this method returns an empty array.

inherited_from \Zend_Validate_Interface::getMessages()

Returns

array

Retrieve flag indicating whether or not value should be obfuscated in messages

getObscureValue() : boolean
Inherited

Returns

boolean

Returns the set schema

getSchema() : string
Inherited

Returns

string

Gets the select object to be used by the validator.

getSelect() : \Zend_Db_Select
Inherited

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 the set table

getTable() : string
Inherited

Returns

string

Return translation object

getTranslator() : \Zend_Translate_Adapter | null
Inherited

Returns

\Zend_Translate_Adapternull

Is there a default translation object set?

hasDefaultTranslator() : boolean
InheritedStatic

Returns

boolean

Does this validator have its own specific translator?

hasTranslator() : boolean
Inherited

Returns

boolean

isValid()

isValid($value) 

Parameters

$value

Sets a new database adapter

setAdapter(\Zend_Db_Adapter_Abstract $adapter) : \Zend_Validate_Db_Abstract
Inherited

Parameters

$adapter

\Zend_Db_Adapter_Abstract

Exceptions

\Zend_Validate_Exception

Returns

\Zend_Validate_Db_Abstract

Set default translation object for all validate objects

setDefaultTranslator(\Zend_Translate|\Zend_Translate_Adapter|null $translator = null
InheritedStatic

Parameters

$translator

\Zend_Translate\Zend_Translate_Adapternull

Exceptions

\Zend_Validate_Exception

Indicate whether or not translation should be disabled

setDisableTranslator(boolean $flag) : \Zend_Validate_Abstract
Inherited

Parameters

$flag

boolean

Returns

\Zend_Validate_Abstract

Sets a new exclude clause

setExclude(string|array $exclude) : \Zend_Validate_Db_Abstract
Inherited

Parameters

$exclude

stringarray

Returns

\Zend_Validate_Db_Abstract

Sets a new field

setField(string $field) : \Zend_Validate_Db_Abstract
Inherited

Parameters

$field

string

Returns

\Zend_Validate_Db_Abstract

Sets the validation failure message template for a particular key

setMessage(string $messageString, string $messageKey = null) : \Zend_Validate_Abstract
Inherited

Parameters

$messageString

string

$messageKey

string

OPTIONAL

Exceptions

\Zend_Validate_Exception

Returns

\Zend_Validate_AbstractProvides a fluent interface

Sets the maximum allowed message length

setMessageLength(integer $length = -1
InheritedStatic

Parameters

$length

integer

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.

setMessages(array $messages) : \Zend_Validate_Abstract
Inherited

Parameters

$messages

array

Returns

\Zend_Validate_Abstract

Set flag indicating whether or not value should be obfuscated in messages

setObscureValue(boolean $flag) : \Zend_Validate_Abstract
Inherited

Parameters

$flag

boolean

Returns

\Zend_Validate_Abstract

Sets a new schema

setSchema(string $schema) : \Zend_Validate_Db_Abstract
Inherited

Parameters

$schema

string

Returns

\Zend_Validate_Db_Abstract

Sets the select object to be used by the validator

setSelect(\Zend_Db_Select $select) : \Zend_Validate_Db_Abstract
Inherited

Parameters

$select

\Zend_Db_Select

Exceptions

\Zend_Validate_Exception

Returns

\Zend_Validate_Db_Abstract

Sets a new table

setTable(string $table) : \Zend_Validate_Db_Abstract
Inherited

Parameters

$table

string

Returns

\Zend_Validate_Db_Abstract

Set translation object

setTranslator(\Zend_Translate|\Zend_Translate_Adapter|null $translator = null) : \Zend_Validate_Abstract
Inherited

Parameters

$translator

\Zend_Translate\Zend_Translate_Adapternull

Exceptions

\Zend_Validate_Exception

Returns

\Zend_Validate_Abstract

Is translation disabled?

translatorIsDisabled() : boolean
Inherited

Returns

boolean

Constructs and returns a validation failure message with the given message key and value.

_createMessage(string $messageKey, string $value) : string
Inherited

Returns null if and only if $messageKey does not correspond to an existing template.

If a translator is available and a translation exists for $messageKey, the translation will be used.

Parameters

$messageKey

string

$value

string

Returns

string

_error()

_error(string $messageKey, string $value = null) : void
Inherited

Parameters

$messageKey

string

$value

string

OPTIONAL

Joins elements of a multidimensional array

_implodeRecursive(array $pieces) : string
Inherited

Parameters

$pieces

array

Returns

string

Run query and returns matches, or null if no matches are found.

_query(String $value) : Array
Inherited

Parameters

$value

String

Returns

Arraywhen matches are found.

Sets the value to be validated and clears the messages and errors arrays

_setValue(mixed $value) : void
Inherited

Parameters

$value

mixed

 Properties

 

Database adapter to use. If null isValid() will use Zend_Db::getInstance instead

$_adapter : \unknown_type

Default

null
 

Default translation object for all validate objects

$_defaultTranslator : \Zend_Translate

Default

Static
 

Array of validation failure message codes

$_errors : array

Default

array()
deprecated Since 1.5.0
 

$_exclude

$_exclude : mixed

Default

null
 

$_field

$_field : string

Default

''
 

Limits the maximum returned length of a error message

$_messageLength : Integer

Default

-1
Static
 

Validation failure message template definitions

$_messageTemplates : array

Default

array()
 

Additional variables available for validation failure messages

$_messageVariables : array

Default

array()
 

Array of validation failure messages

$_messages : array

Default

array()
 

Flag indidcating whether or not value should be obfuscated in error messages

$_obscureValue : boolean

Default

false
 

$_schema

$_schema : string

Default

null
 

Select object to use. can be set, or will be auto-generated

$_select : \Zend_Db_Select

Default

 

$_table

$_table : string

Default

''
 

Translation object

$_translator : \Zend_Translate

Default

 

Is translation disabled?

$_translatorDisabled : Boolean

Default

false
 

The value to be validated

$_value : mixed

Default

 Constants

 

Error constants

ERROR_NO_RECORD_FOUND = 'noRecordFound' 
 

ERROR_RECORD_FOUND

ERROR_RECORD_FOUND = 'recordFound'