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
ERROR_NO_RECORD_FOUND = 'noRecordFound'
Error constants
ERROR_RECORD_FOUND = 'recordFound'
unknown_type $_adapter = 'null'
Database adapter to use. If null isValid() will use Zend_Db::getInstance instead
mixed $_exclude = 'null'
string $_field = ''
array $_messageTemplates = 'array'
string $_schema = 'null'
string $_table = ''
__construct(
array|Zend_Config $options
)
:
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
_query(
String $value
)
:
Array
Run query and returns matches, or null if no matches are found.
getAdapter(
)
:
Zend_Db_Adapter
Returns the set adapter
getExclude(
)
:
string|array
Returns the set exclude clause
getField(
)
:
string|array
Returns the set field
getSchema(
)
:
string
Returns the set schema
getTable(
)
:
string
Returns the set table
setAdapter(
Zend_Db_Adapter_Abstract $adapter
)
:
Zend_Validate_Db_Abstract
Sets a new database adapter
setExclude(
string|array $exclude
)
:
Zend_Validate_Db_Abstract
Sets a new exclude clause
setField(
string $field
)
:
Zend_Validate_Db_Abstract
Sets a new field
setSchema(
string $schema
)
:
Zend_Validate_Db_Abstract
Sets a new schema
setTable(
string $table
)
:
Zend_Validate_Db_Abstract
Sets a new table