|
Moodle
2.2.1
http://www.collinsharper.com
|


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 | |
Definition at line 36 of file Abstract.php.
| __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
| array | Zend_Config | $options | Options to use for this validator |
Definition at line 95 of file Abstract.php.

| _query | ( | $ | value | ) | [protected] |
Run query and returns matches, or null if no matches are found.
| String | $value |
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.

| getAdapter | ( | ) |
| getExclude | ( | ) |
| getField | ( | ) |
| getSchema | ( | ) |
| getTable | ( | ) |
| setAdapter | ( | $ | adapter | ) |
Sets a new database adapter
| Zend_Db_Adapter_Abstract | $adapter |
Definition at line 158 of file Abstract.php.

| setExclude | ( | $ | exclude | ) |
Sets a new exclude clause
| string | array | $exclude |
Definition at line 185 of file Abstract.php.

| setField | ( | $ | field | ) |
Sets a new field
| string | $field |
Definition at line 207 of file Abstract.php.

| setSchema | ( | $ | schema | ) |
Sets a new schema
| string | $schema |
Definition at line 251 of file Abstract.php.

| setTable | ( | $ | table | ) |
Sets a new table
| string | $table |
Definition at line 229 of file Abstract.php.

$_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] |
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.