Confirms a record does not exist in a table.

category Zend
package Zend_Validator

 Methods

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

__construct(array | \Traversable | \Zend\Db\Sql\Select $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

inherited_from \Zend\Validator\Db\AbstractDb::__construct()

Parameters

$options

array\Traversable\Zend\Db\Sql\Select

Options to use for this validator

Exceptions

\Zend\Validator\Exception\InvalidArgumentException

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

inherited_from \Zend\Validator\AbstractValidator::__get()
inherited_from \Zend\Validator\Db\AbstractDb::__get()

Parameters

$property

string

Exceptions

\Zend\Validator\Exception\InvalidArgumentException

Returns

mixed

Invoke as command

__invoke(mixed $value) : bool
Inherited

inherited_from \Zend\Validator\AbstractValidator::__invoke()
inherited_from \Zend\Validator\Db\AbstractDb::__invoke()

Parameters

$value

mixed

Returns

bool

Returns the set adapter

getAdapter() : \Zend\Db\Adapter\Adapter
Inherited

inherited_from \Zend\Validator\Db\AbstractDb::getAdapter()

Exceptions

\Zend\Validator\Exception\RuntimeException When no database adapter is defined

Returns

Get default translation object for all validate objects

getDefaultTranslator() : \Zend\I18n\Translator\Translator | null
Inherited

inherited_from \Zend\Validator\AbstractValidator::getDefaultTranslator()
inherited_from \Zend\Validator\Db\AbstractDb::getDefaultTranslator()

Returns

Get default translation text domain for all validate objects

getDefaultTranslatorTextDomain() : string
Inherited

inherited_from \Zend\Validator\AbstractValidator::getDefaultTranslatorTextDomain()
inherited_from \Zend\Validator\Db\AbstractDb::getDefaultTranslatorTextDomain()

Returns

string

Returns the set exclude clause

getExclude() : string | array
Inherited

inherited_from \Zend\Validator\Db\AbstractDb::getExclude()

Returns

stringarray

Returns the set field

getField() : string | array
Inherited

inherited_from \Zend\Validator\Db\AbstractDb::getField()

Returns

stringarray

Returns the maximum allowed message length

getMessageLength() : integer
Inherited

inherited_from \Zend\Validator\AbstractValidator::getMessageLength()
inherited_from \Zend\Validator\Db\AbstractDb::getMessageLength()

Returns

integer

Returns the message templates from the validator

getMessageTemplates() : array
Inherited

inherited_from \Zend\Validator\AbstractValidator::getMessageTemplates()
inherited_from \Zend\Validator\Db\AbstractDb::getMessageTemplates()

Returns

array

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

getMessageVariables() : array
Inherited

inherited_from \Zend\Validator\AbstractValidator::getMessageVariables()
inherited_from \Zend\Validator\Db\AbstractDb::getMessageVariables()

Returns

array

Returns array of validation failure messages

getMessages() : array
Inherited

The array keys are validation failure message identifiers, and the array values are the corresponding human-readable message strings.

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

inherited_from \Zend\Validator\AbstractValidator::getMessages()
inherited_from \Zend\Validator\Db\AbstractDb::getMessages()

Returns

array

Returns an option

getOption(string $option) : mixed
Inherited

inherited_from \Zend\Validator\AbstractValidator::getOption()
inherited_from \Zend\Validator\Db\AbstractDb::getOption()

Parameters

$option

string

Option to be returned

Exceptions

\Zend\Validator\Exception\InvalidArgumentException

Returns

mixedReturned option

Returns all available options

getOptions() : array
Inherited

inherited_from \Zend\Validator\AbstractValidator::getOptions()
inherited_from \Zend\Validator\Db\AbstractDb::getOptions()

Returns

arrayArray with all available options

Returns the set schema

getSchema() : string
Inherited

inherited_from \Zend\Validator\Db\AbstractDb::getSchema()

Returns

string

Gets the select object to be used by the validator.

getSelect() : \Zend\Db\Sql\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.

inherited_from \Zend\Validator\Db\AbstractDb::getSelect()

Returns

\Zend\Db\Sql\SelectThe Select object which will be used

Returns the set table

getTable() : string
Inherited

inherited_from \Zend\Validator\Db\AbstractDb::getTable()

Returns

string

Return translation object

getTranslator() : \Zend\I18n\Translator\Translator | null
Inherited

inherited_from \Zend\Validator\AbstractValidator::getTranslator()
inherited_from \Zend\Validator\Db\AbstractDb::getTranslator()

Returns

Return the translation text domain

getTranslatorTextDomain() : string
Inherited

inherited_from \Zend\Validator\AbstractValidator::getTranslatorTextDomain()
inherited_from \Zend\Validator\Db\AbstractDb::getTranslatorTextDomain()

Returns

string

Is there a default translation object set?

hasDefaultTranslator() : bool
Inherited

inherited_from \Zend\Validator\AbstractValidator::hasDefaultTranslator()
inherited_from \Zend\Validator\Db\AbstractDb::hasDefaultTranslator()

Returns

bool

Does this validator have its own specific translator?

hasTranslator() : bool
Inherited

inherited_from \Zend\Validator\AbstractValidator::hasTranslator()
inherited_from \Zend\Validator\Db\AbstractDb::hasTranslator()

Returns

bool

Is translation enabled?

isTranslatorEnabled() : bool
Inherited

inherited_from \Zend\Validator\AbstractValidator::isTranslatorEnabled()
inherited_from \Zend\Validator\Db\AbstractDb::isTranslatorEnabled()

Returns

bool

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

isValid(mixed $value) : bool

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

Exceptions

\Zend\Validator\Exception\RuntimeException If validation of $value is impossible

Returns

bool

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

isValueObscured() : bool
Inherited

inherited_from \Zend\Validator\AbstractValidator::isValueObscured()
inherited_from \Zend\Validator\Db\AbstractDb::isValueObscured()

Returns

bool

Sets a new database adapter

setAdapter(\Zend\Db\Adapter\Adapter $adapter) : \Zend\Validator\Db\self
Inherited

inherited_from \Zend\Validator\Db\AbstractDb::setAdapter()

Parameters

Returns

\Zend\Validator\Db\selfProvides a fluent interface

Set default translation object for all validate objects

setDefaultTranslator(\Zend\I18n\Translator\Translator $translator, string $textDomain) : void
Inherited

inherited_from \Zend\Validator\AbstractValidator::setDefaultTranslator()
inherited_from \Zend\Validator\Db\AbstractDb::setDefaultTranslator()

Parameters

$textDomain

string

(optional)

Exceptions

\Zend\Validator\Exception\InvalidArgumentException

Set default translation text domain for all validate objects

setDefaultTranslatorTextDomain(string $textDomain) : void
Inherited

inherited_from \Zend\Validator\AbstractValidator::setDefaultTranslatorTextDomain()
inherited_from \Zend\Validator\Db\AbstractDb::setDefaultTranslatorTextDomain()

Parameters

$textDomain

string

Sets a new exclude clause

setExclude(string | array $exclude) : \Zend\Validator\Db\self
Inherited

inherited_from \Zend\Validator\Db\AbstractDb::setExclude()

Parameters

$exclude

stringarray

Returns

\Zend\Validator\Db\selfProvides a fluent interface

Sets a new field

setField(string $field) : \Zend\Validator\Db\AbstractDb
Inherited

inherited_from \Zend\Validator\Db\AbstractDb::setField()

Parameters

$field

string

Returns

Sets the validation failure message template for a particular key

setMessage(string $messageString, string $messageKey) : \Zend\Validator\AbstractValidator
Inherited

inherited_from \Zend\Validator\AbstractValidator::setMessage()
inherited_from \Zend\Validator\Db\AbstractDb::setMessage()

Parameters

$messageString

string

$messageKey

string

OPTIONAL

Exceptions

\Zend\Validator\Exception\InvalidArgumentException

Returns

\Zend\Validator\AbstractValidatorProvides a fluent interface

Sets the maximum allowed message length

setMessageLength(integer $length) 
Inherited

inherited_from \Zend\Validator\AbstractValidator::setMessageLength()
inherited_from \Zend\Validator\Db\AbstractDb::setMessageLength()

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\Validator\AbstractValidator
Inherited

inherited_from \Zend\Validator\AbstractValidator::setMessages()
inherited_from \Zend\Validator\Db\AbstractDb::setMessages()

Parameters

$messages

array

Returns

Sets one or multiple options

setOptions(array | \Traversable $options) : \Zend\Validator\AbstractValidator
Inherited

inherited_from \Zend\Validator\AbstractValidator::setOptions()
inherited_from \Zend\Validator\Db\AbstractDb::setOptions()

Parameters

$options

array\Traversable

Options to set

Exceptions

\Zend\Validator\Exception\InvalidArgumentException If $options is not an array or Traversable

Returns

\Zend\Validator\AbstractValidatorProvides fluid interface

Sets a new schema

setSchema(string $schema) : \Zend\Validator\Db\self
Inherited

inherited_from \Zend\Validator\Db\AbstractDb::setSchema()

Parameters

$schema

string

Returns

\Zend\Validator\Db\selfProvides a fluent interface

Sets the select object to be used by the validator

setSelect(\Zend\Db\Sql\Select $select) : \Zend\Validator\Db\self
Inherited

inherited_from \Zend\Validator\Db\AbstractDb::setSelect()

Parameters

Returns

\Zend\Validator\Db\selfProvides a fluent interface

Sets a new table

setTable(string $table) : \Zend\Validator\Db\self
Inherited

inherited_from \Zend\Validator\Db\AbstractDb::setTable()

Parameters

$table

string

Returns

\Zend\Validator\Db\selfProvides a fluent interface

Set translation object

setTranslator(\Zend\I18n\Translator\Translator $translator, string $textDomain) : \Zend\Validator\AbstractValidator
Inherited

inherited_from \Zend\Validator\AbstractValidator::setTranslator()
inherited_from \Zend\Validator\Db\AbstractDb::setTranslator()

Parameters

$textDomain

string

(optional)

Exceptions

\Zend\Validator\Exception\InvalidArgumentException

Returns

Indicate whether or not translation should be enabled

setTranslatorEnabled(bool $flag) : \Zend\Validator\AbstractValidator
Inherited

inherited_from \Zend\Validator\AbstractValidator::setTranslatorEnabled()
inherited_from \Zend\Validator\Db\AbstractDb::setTranslatorEnabled()

Parameters

$flag

bool

Returns

Set translation text domain

setTranslatorTextDomain(string $textDomain) : \Zend\Validator\AbstractValidator
Inherited

inherited_from \Zend\Validator\AbstractValidator::setTranslatorTextDomain()
inherited_from \Zend\Validator\Db\AbstractDb::setTranslatorTextDomain()

Parameters

$textDomain

string

Returns

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

setValueObscured(bool $flag) : \Zend\Validator\AbstractValidator
Inherited

inherited_from \Zend\Validator\AbstractValidator::setValueObscured()
inherited_from \Zend\Validator\Db\AbstractDb::setValueObscured()

Parameters

$flag

bool

Returns

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

createMessage(string $messageKey, string | array | object $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.

inherited_from \Zend\Validator\AbstractValidator::createMessage()
inherited_from \Zend\Validator\Db\AbstractDb::createMessage()

Parameters

$messageKey

string

$value

stringarrayobject

Returns

string

error()

error(string $messageKey, string $value) : void
Inherited

inherited_from \Zend\Validator\AbstractValidator::error()
inherited_from \Zend\Validator\Db\AbstractDb::error()

Parameters

$messageKey

string

$value

string

OPTIONAL

Returns the validation value

getValue() : mixed
Inherited

inherited_from \Zend\Validator\AbstractValidator::getValue()
inherited_from \Zend\Validator\Db\AbstractDb::getValue()

Returns

mixedValue to be validated

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

query(string $value) : array
Inherited

inherited_from \Zend\Validator\Db\AbstractDb::query()

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

inherited_from \Zend\Validator\AbstractValidator::setValue()
inherited_from \Zend\Validator\Db\AbstractDb::setValue()

Parameters

$value

mixed

Translate a validation message

translateMessage(string $messageKey, string $message) : string
Inherited

inherited_from \Zend\Validator\AbstractValidator::translateMessage()
inherited_from \Zend\Validator\Db\AbstractDb::translateMessage()

Parameters

$messageKey

string

$message

string

Returns

string

 Properties

 

$abstractOptions

$abstractOptions 
Inherited

inherited_from \Zend\Validator\AbstractValidator::$$abstractOptions
inherited_from \Zend\Validator\Db\AbstractDb::$$abstractOptions
 

Database adapter to use.

$adapter : \Zend\Db\Adapter\Adapter
Inherited

If null isValid() will throw an exception

inherited_from \Zend\Validator\Db\AbstractDb::$$adapter
 

Default translation object for all validate objects

$defaultTranslator : \Zend\I18n\Translator\Translator
Inherited

inherited_from \Zend\Validator\AbstractValidator::$$defaultTranslator
inherited_from \Zend\Validator\Db\AbstractDb::$$defaultTranslator
 

Default text domain to be used with translator

$defaultTranslatorTextDomain : string
Inherited

inherited_from \Zend\Validator\AbstractValidator::$$defaultTranslatorTextDomain
inherited_from \Zend\Validator\Db\AbstractDb::$$defaultTranslatorTextDomain
 

$exclude

$exclude : mixed
Inherited

inherited_from \Zend\Validator\Db\AbstractDb::$$exclude
 

$field

$field : string
Inherited

inherited_from \Zend\Validator\Db\AbstractDb::$$field
 

Limits the maximum returned length of a error message

$messageLength : Integer
Inherited

inherited_from \Zend\Validator\AbstractValidator::$$messageLength
inherited_from \Zend\Validator\Db\AbstractDb::$$messageLength
 

<p>Message templates</p>

$messageTemplates : array
Inherited

inherited_from \Zend\Validator\Db\AbstractDb::$$messageTemplates
 

$schema

$schema : string
Inherited

inherited_from \Zend\Validator\Db\AbstractDb::$$schema
 

Select object to use.

$select : \Zend\Db\Sql\Select
Inherited

can be set, or will be auto-generated

inherited_from \Zend\Validator\Db\AbstractDb::$$select
 

$table

$table : string
Inherited

inherited_from \Zend\Validator\Db\AbstractDb::$$table
 

The value to be validated

$value : mixed
Inherited

inherited_from \Zend\Validator\AbstractValidator::$$value
inherited_from \Zend\Validator\Db\AbstractDb::$$value

 Constants

 

Error constants

ERROR_NO_RECORD_FOUND 
Inherited

inherited_from \Zend\Validator\Db\AbstractDb::ERROR_NO_RECORD_FOUND
 

ERROR_RECORD_FOUND

ERROR_RECORD_FOUND 
Inherited

inherited_from \Zend\Validator\Db\AbstractDb::ERROR_RECORD_FOUND