Moodle  2.2.1
http://www.collinsharper.com
Zend_Validate_Db_Abstract Class Reference
Inheritance diagram for Zend_Validate_Db_Abstract:
Collaboration diagram for Zend_Validate_Db_Abstract:

Public Member Functions

 __construct ($options)
 getAdapter ()
 setAdapter ($adapter)
 getExclude ()
 setExclude ($exclude)
 getField ()
 setField ($field)
 getTable ()
 setTable ($table)
 getSchema ()
 setSchema ($schema)

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 36 of file Abstract.php.


Constructor & Destructor Documentation

__construct ( 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

Parameters:
array | Zend_Config$optionsOptions to use for this validator

Definition at line 95 of file Abstract.php.

Here is the call graph for this function:


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 263 of file Abstract.php.

Here is the caller graph for this function:

Returns the set adapter

Returns:
Zend_Db_Adapter

Definition at line 147 of file Abstract.php.

Returns the set exclude clause

Returns:
string|array

Definition at line 174 of file Abstract.php.

getField ( )

Returns the set field

Returns:
string|array

Definition at line 196 of file Abstract.php.

getSchema ( )

Returns the set schema

Returns:
string

Definition at line 240 of file Abstract.php.

getTable ( )

Returns the set table

Returns:
string

Definition at line 218 of file Abstract.php.

setAdapter ( adapter)

Sets a new database adapter

Parameters:
Zend_Db_Adapter_Abstract$adapter
Returns:
Zend_Validate_Db_Abstract

Definition at line 158 of file Abstract.php.

Here is the caller graph for this function:

setExclude ( exclude)

Sets a new exclude clause

Parameters:
string | array$exclude
Returns:
Zend_Validate_Db_Abstract

Definition at line 185 of file Abstract.php.

Here is the caller graph for this function:

setField ( field)

Sets a new field

Parameters:
string$field
Returns:
Zend_Validate_Db_Abstract

Definition at line 207 of file Abstract.php.

Here is the caller graph for this function:

setSchema ( schema)

Sets a new schema

Parameters:
string$schema
Returns:
Zend_Validate_Db_Abstract

Definition at line 251 of file Abstract.php.

Here is the caller graph for this function:

setTable ( table)

Sets a new table

Parameters:
string$table
Returns:
Zend_Validate_Db_Abstract

Definition at line 229 of file Abstract.php.

Here is the caller graph for this function:


Field Documentation

$_adapter = null [protected]

Definition at line 77 of file Abstract.php.

$_exclude = null [protected]

Definition at line 70 of file Abstract.php.

$_field = '' [protected]

Definition at line 65 of file Abstract.php.

$_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 47 of file Abstract.php.

$_schema = null [protected]

Definition at line 55 of file Abstract.php.

$_table = '' [protected]

Definition at line 60 of file Abstract.php.

const ERROR_NO_RECORD_FOUND = 'noRecordFound'

Error constants

Definition at line 41 of file Abstract.php.

const ERROR_RECORD_FOUND = 'recordFound'

Definition at line 42 of file Abstract.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations