Public Member Functions | Data Fields | Protected Member Functions | Protected Attributes

Zend_Validate_Db_Abstract Class Reference

Inheritance diagram for Zend_Validate_Db_Abstract:
Zend_Validate_Abstract Zend_Validate_Interface Zend_Validate_Db_NoRecordExists Zend_Validate_Db_RecordExists

Public Member Functions

 __construct ($table, $field, $exclude=null, Zend_Db_Adapter_Abstract $adapter=null)

Data Fields

const ERROR_NO_RECORD_FOUND = 'noRecordFound'
const ERROR_RECORD_FOUND = 'recordFound'

Protected Member Functions

 _query ($value)

Protected Attributes

 $_messageTemplates
 $_schema = null
 $_table = ''
 $_field = ''
 $_exclude = null
 $_adapter = null

Detailed Description

Definition at line 37 of file Abstract.php.


Constructor & Destructor Documentation

__construct ( table,
field,
exclude = null,
Zend_Db_Adapter_Abstract adapter = null 
)

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.

Parameters:
string||array$table The database table to validate against, or array with table and schema keys
string$fieldThe field to check for a match
string||array$exclude An optional where clause or field/value pair to exclude from the query
Zend_Db_Adapter_Abstract$adapterAn optional database adapter to use.

Definition at line 90 of file Abstract.php.


Member Function Documentation

_query ( value ) [protected]

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

Parameters:
String$value
Returns:
Array when matches are found.

Check for an adapter being defined. if not, fetch the default adapter.

Build select object

Run query

Definition at line 113 of file Abstract.php.


Field Documentation

$_messageTemplates [protected]
Initial value:
 array(self::ERROR_NO_RECORD_FOUND => 'No record matching %value% was found',
                                         self::ERROR_RECORD_FOUND    => 'A record matching %value% was found')

Reimplemented from Zend_Validate_Abstract.

Definition at line 48 of file Abstract.php.

const ERROR_NO_RECORD_FOUND = 'noRecordFound'

Error constants

Definition at line 42 of file Abstract.php.


The documentation for this class was generated from the following file: