Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.
Class for Database record validation

\unknown_type
$_adapter= 'null'
Database adapter to use. If null isValid() will use Zend_Db::getInstance instead
null
Details
array
$_messageTemplates= 'array(
self::ERROR_NO_RECORD_FOUND => "No record matching '%value%' was found"'
array(
self::ERROR_NO_RECORD_FOUND => "No record matching '%value%' was found"
Details
\Zend_Db_Select
$_select= ''
Select object to use. can be set, or will be auto-generated

__construct(
array|\Zend_Config $options
)
:
void
Provides basic configuration for use with Zend_Validate_Db Validators Setting $exclude allows a single record to be excluded from matching.
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
Name | Type | Description |
---|---|---|
$options | array|\Zend_Config | Options to use for this validator |

_query(
String $value
)
:
Array
Run query and returns matches, or null if no matches are found.
Name | Type | Description |
---|---|---|
$value | String |
Type | Description |
---|---|
Array | when matches are found. |

getSelect(
)
:
\Zend_Db_Select
Gets the select object to be used by the validator.
If no select object was supplied to the constructor, then it will auto-generate one from the given table, schema, field, and adapter options.
Type | Description |
---|---|
\Zend_Db_Select | The Select object which will be used |

setAdapter(
\Zend_Db_Adapter_Abstract $adapter
)
:
\Zend_Validate_Db_Abstract
Sets a new database adapter
Name | Type | Description |
---|---|---|
$adapter | \Zend_Db_Adapter_Abstract |
Type | Description |
---|---|
\Zend_Validate_Db_Abstract |

setExclude(
string|array $exclude
)
:
\Zend_Validate_Db_Abstract
Sets a new exclude clause
Name | Type | Description |
---|---|---|
$exclude | string|array |
Type | Description |
---|---|
\Zend_Validate_Db_Abstract |

setSelect(
\Zend_Db_Select $select
)
:
\Zend_Validate_Db_Abstract
Sets the select object to be used by the validator
Name | Type | Description |
---|---|---|
$select | \Zend_Db_Select |
Type | Description |
---|---|
\Zend_Validate_Db_Abstract |