Abstract Class Zend_Validate_Db_Abstract

Description

Class for Database record validation

Located in /Validate/Db/Abstract.php (line 36)

Zend_Validate_Abstract
   |
   --Zend_Validate_Db_Abstract
Direct descendents
Class Description
 class Zend_Validate_Db_NoRecordExists Confirms a record does not exist in a table.
 class Zend_Validate_Db_RecordExists Confirms a record exists in a table.
Class Constant Summary
 ERROR_NO_RECORD_FOUND = 'noRecordFound'
 ERROR_RECORD_FOUND = 'recordFound'
Variable Summary
 unknown_type $_adapter
 mixed $_exclude
 string $_field
 string $_schema
 string $_table
Method Summary
 Zend_Validate_Db_Abstract __construct (array|Zend_Config $options)
 Zend_Db_Adapter getAdapter ()
 string|array getExclude ()
 string|array getField ()
 string getSchema ()
 string getTable ()
 Zend_Validate_Db_Abstract setExclude (string|array $exclude)
 Array _query (String $value)
Variables
unknown_type $_adapter = null (line 77)

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

  • access: protected
mixed $_exclude = null (line 70)
  • access: protected
string $_field = '' (line 65)
  • access: protected
array $_messageTemplates = array(
self::ERROR_NO_RECORD_FOUND => 'No record matching %value% was found',
self::ERROR_RECORD_FOUND => 'A record matching %value% was found',
)
(line 47)
  • var: Message templates
  • access: protected

Redefinition of:
Zend_Validate_Abstract::$_messageTemplates
Validation failure message template definitions
string $_schema = null (line 55)
  • access: protected
string $_table = '' (line 60)
  • access: protected

Inherited Variables

Inherited from Zend_Validate_Abstract

Zend_Validate_Abstract::$_defaultTranslator
Zend_Validate_Abstract::$_errors
Zend_Validate_Abstract::$_messageLength
Zend_Validate_Abstract::$_messages
Zend_Validate_Abstract::$_messageVariables
Zend_Validate_Abstract::$_obscureValue
Zend_Validate_Abstract::$_translator
Zend_Validate_Abstract::$_translatorDisabled
Zend_Validate_Abstract::$_value
Methods
Constructor __construct (line 95)

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

  • access: public
Zend_Validate_Db_Abstract __construct (array|Zend_Config $options)
  • array|Zend_Config $options: Options to use for this validator
getAdapter (line 147)

Returns the set adapter

  • access: public
Zend_Db_Adapter getAdapter ()
getExclude (line 174)

Returns the set exclude clause

  • access: public
string|array getExclude ()
getField (line 196)

Returns the set field

  • access: public
string|array getField ()
getSchema (line 240)

Returns the set schema

  • access: public
string getSchema ()
getTable (line 218)

Returns the set table

  • access: public
string getTable ()
setAdapter (line 158)

Sets a new database adapter

  • access: public
setExclude (line 185)

Sets a new exclude clause

  • access: public
Zend_Validate_Db_Abstract setExclude (string|array $exclude)
  • string|array $exclude
setField (line 207)

Sets a new field

  • access: public
Zend_Validate_Db_Abstract setField (string $field)
  • string $field
setSchema (line 251)

Sets a new schema

  • access: public
Zend_Validate_Db_Abstract setSchema (string $schema)
  • string $schema
setTable (line 229)

Sets a new table

  • access: public
Zend_Validate_Db_Abstract setTable (string $table)
  • string $table
_query (line 263)

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

  • return: when matches are found.
  • access: protected
Array _query (String $value)
  • String $value

Inherited Methods

Inherited From Zend_Validate_Abstract

 Zend_Validate_Abstract::getDefaultTranslator()
 Zend_Validate_Abstract::getErrors()
 Zend_Validate_Abstract::getMessageLength()
 Zend_Validate_Abstract::getMessages()
 Zend_Validate_Abstract::getMessageTemplates()
 Zend_Validate_Abstract::getMessageVariables()
 Zend_Validate_Abstract::getObscureValue()
 Zend_Validate_Abstract::getTranslator()
 Zend_Validate_Abstract::hasDefaultTranslator()
 Zend_Validate_Abstract::hasTranslator()
 Zend_Validate_Abstract::setDefaultTranslator()
 Zend_Validate_Abstract::setDisableTranslator()
 Zend_Validate_Abstract::setMessage()
 Zend_Validate_Abstract::setMessageLength()
 Zend_Validate_Abstract::setMessages()
 Zend_Validate_Abstract::setObscureValue()
 Zend_Validate_Abstract::setTranslator()
 Zend_Validate_Abstract::translatorIsDisabled()
 Zend_Validate_Abstract::_createMessage()
 Zend_Validate_Abstract::_error()
 Zend_Validate_Abstract::_setValue()
 Zend_Validate_Abstract::__get()
Class Constants
ERROR_NO_RECORD_FOUND = 'noRecordFound' (line 41)

Error constants

ERROR_RECORD_FOUND = 'recordFound' (line 42)

Documentation generated on Mon, 21 Jun 2010 15:05:14 -0400 by phpDocumentor 1.4.3