Moodle  2.2.1
http://www.collinsharper.com
ADODB_Active_Record Class Reference

Public Member Functions

 __set ($name, $value)
 __construct ($table=false, $pkeyarr=false, $db=false)
 __wakeup ()
 _pluralize ($table)
 _singularize ($tables)
 hasMany ($foreignRef, $foreignKey=false, $foreignClass= 'ADODB_Active_Record')
 belongsTo ($foreignRef, $foreignKey=false, $parentKey='', $parentClass= 'ADODB_Active_Record')
 __get ($name)
 LoadRelations ($name, $whereOrderBy='', $offset=-1, $limit=-1)
 UpdateActiveTable ($pkeys=false, $forceUpdate=false)
 GetPrimaryKeys (&$db, $table)
 Error ($err, $fn)
 ErrorMsg ()
 ErrorNo ()
 DB ()
TableInfo ()
 Reload ()
 Set (&$row)
 LastInsertID (&$db, $fieldname)
 doquote (&$db, $val, $t)
 GenWhere (&$db, &$table)
 _QName ($n, $db=false)
 Load ($where=null, $bindarr=false)
 Reset ()
 Save ()
 Insert ()
 Delete ()
 Find ($whereOrderBy, $bindarr=false, $pkeysArr=false, $extra=array())
 Replace ()
 Update ()
 GetAttributeNames ()
 __set ($name, $value)
 __construct ($table=false, $pkeyarr=false, $db=false, $options=array())
 __wakeup ()
 _pluralize ($table)
 _singularize ($table)
 hasMany ($foreignRef, $foreignKey=false)
 belongsTo ($foreignRef, $foreignKey=false)
 __get ($name)
 LoadRelations ($name, $whereOrderBy, $offset=-1, $limit=-1)
 UpdateActiveTable ($pkeys=false, $forceUpdate=false)
 GetPrimaryKeys (&$db, $table)
 Error ($err, $fn)
 ErrorMsg ()
 ErrorNo ()
 DB ()
TableInfo ()
 Reload ()
 Set (&$row)
 LastInsertID (&$db, $fieldname)
 doquote (&$db, $val, $t)
 GenWhere (&$db, &$table)
 Load ($where=null, $bindarr=false)
 Save ()
 Dirty ()
 Insert ()
 Delete ()
 Find ($whereOrderBy, $bindarr=false, $pkeysArr=false, $extra=array())
 packageFind ($whereOrderBy, $bindarr=false, $pkeysArr=false, $extra=array())
 Replace ()
 Update ()
 GetAttributeNames ()

Static Public Member Functions

static UseDefaultValues ($bool=null)
static SetDatabaseAdapter (&$db, $index=false)
static TableHasMany ($table, $foreignRef, $foreignKey=false, $foreignClass= 'ADODB_Active_Record')
static TableKeyHasMany ($table, $tablePKey, $foreignRef, $foreignKey=false, $foreignClass= 'ADODB_Active_Record')
static ClassHasMany ($parentclass, $foreignRef, $foreignKey=false, $foreignClass= 'ADODB_Active_Record')
static ClassBelongsTo ($class, $foreignRef, $foreignKey=false, $parentKey='', $parentClass= 'ADODB_Active_Record')
static TableBelongsTo ($table, $foreignRef, $foreignKey=false, $parentKey='', $parentClass= 'ADODB_Active_Record')
static TableKeyBelongsTo ($table, $tablePKey, $foreignRef, $foreignKey=false, $parentKey='', $parentClass= 'ADODB_Active_Record')
static UseDefaultValues ($bool=null)
static SetDatabaseAdapter (&$db)

Data Fields

 $_dbat
 $_table
 $_tableat
 $_where
 $_saved = false
 $_lasterr = false
 $_original = false
 $foreignName
 $_sTable
 $_pTable

Static Public Attributes

static $_changeNames = true
static $_quoteNames = false
static $_foreignSuffix = '_id'
static $IrregularP
static $IrregularS
static $WeIsI

Detailed Description

Definition at line 75 of file adodb-active-record.inc.php.


Constructor & Destructor Documentation

__construct ( table = false,
pkeyarr = false,
db = false 
)

Definition at line 111 of file adodb-active-record.inc.php.

Here is the call graph for this function:

__construct ( table = false,
pkeyarr = false,
db = false,
options = array() 
)

Definition at line 131 of file adodb-active-recordx.inc.php.

Here is the call graph for this function:


Member Function Documentation

__get ( name)

__get Access properties - used for lazy loading

Parameters:
mixed$nameprotected
Returns:
mixed

Definition at line 274 of file adodb-active-record.inc.php.

Here is the call graph for this function:

__get ( name)

__get Access properties - used for lazy loading

Parameters:
mixed$nameprotected
Returns:
void

Definition at line 340 of file adodb-active-recordx.inc.php.

Here is the call graph for this function:

__set ( name,
value 
)

Definition at line 104 of file adodb-active-record.inc.php.

__set ( name,
value 
)

Definition at line 115 of file adodb-active-recordx.inc.php.

__wakeup ( )

Definition at line 139 of file adodb-active-record.inc.php.

__wakeup ( )

Definition at line 182 of file adodb-active-recordx.inc.php.

_pluralize ( table)

Definition at line 145 of file adodb-active-record.inc.php.

Here is the caller graph for this function:

_pluralize ( table)

Definition at line 216 of file adodb-active-recordx.inc.php.

_QName ( n,
db = false 
)

Definition at line 671 of file adodb-active-record.inc.php.

Here is the call graph for this function:

Here is the caller graph for this function:

_singularize ( tables)

Definition at line 170 of file adodb-active-record.inc.php.

Here is the caller graph for this function:

_singularize ( table)

Definition at line 249 of file adodb-active-recordx.inc.php.

belongsTo ( foreignRef,
foreignKey = false,
parentKey = '',
parentClass = 'ADODB_Active_Record' 
)

Definition at line 232 of file adodb-active-record.inc.php.

Here is the call graph for this function:

belongsTo ( foreignRef,
foreignKey = false 
)

ar->foreignName will contain the name of the tables associated with this table because this table's rows may also be referenced by those tables using thistable_id or the provided foreign keys (this index name is stored in ar->foreignKey)

this-table.other-table_id = other-table.id

Definition at line 315 of file adodb-active-recordx.inc.php.

Here is the call graph for this function:

static ClassBelongsTo ( class,
foreignRef,
foreignKey = false,
parentKey = '',
parentClass = 'ADODB_Active_Record' 
) [static]

Definition at line 247 of file adodb-active-record.inc.php.

static ClassHasMany ( parentclass,
foreignRef,
foreignKey = false,
foreignClass = 'ADODB_Active_Record' 
) [static]

Definition at line 225 of file adodb-active-record.inc.php.

DB ( )

Definition at line 531 of file adodb-active-record.inc.php.

Here is the call graph for this function:

Here is the caller graph for this function:

DB ( )

Definition at line 583 of file adodb-active-recordx.inc.php.

Here is the call graph for this function:

Delete ( )

Definition at line 783 of file adodb-active-record.inc.php.

Here is the call graph for this function:

Delete ( )

Definition at line 949 of file adodb-active-recordx.inc.php.

Here is the call graph for this function:

Dirty ( )

Definition at line 893 of file adodb-active-recordx.inc.php.

doquote ( &$  db,
val,
t 
)

Definition at line 629 of file adodb-active-record.inc.php.

Here is the caller graph for this function:

doquote ( &$  db,
val,
t 
)

Definition at line 707 of file adodb-active-recordx.inc.php.

Error ( err,
fn 
)

Definition at line 487 of file adodb-active-record.inc.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Error ( err,
fn 
)

Definition at line 539 of file adodb-active-recordx.inc.php.

Here is the call graph for this function:

ErrorMsg ( )

Definition at line 509 of file adodb-active-record.inc.php.

Here is the call graph for this function:

ErrorMsg ( )

Definition at line 561 of file adodb-active-recordx.inc.php.

Here is the call graph for this function:

ErrorNo ( )

Definition at line 521 of file adodb-active-record.inc.php.

Here is the call graph for this function:

ErrorNo ( )

Definition at line 573 of file adodb-active-recordx.inc.php.

Here is the call graph for this function:

Find ( whereOrderBy,
bindarr = false,
pkeysArr = false,
extra = array() 
)

Definition at line 796 of file adodb-active-record.inc.php.

Here is the call graph for this function:

Find ( whereOrderBy,
bindarr = false,
pkeysArr = false,
extra = array() 
)

Definition at line 962 of file adodb-active-recordx.inc.php.

Here is the call graph for this function:

GenWhere ( &$  db,
&$  table 
)

Definition at line 656 of file adodb-active-record.inc.php.

Here is the call graph for this function:

Here is the caller graph for this function:

GenWhere ( &$  db,
&$  table 
)

Definition at line 730 of file adodb-active-recordx.inc.php.

Here is the call graph for this function:

Definition at line 922 of file adodb-active-record.inc.php.

Here is the call graph for this function:

Definition at line 1101 of file adodb-active-recordx.inc.php.

Here is the call graph for this function:

GetPrimaryKeys ( &$  db,
table 
)

Definition at line 481 of file adodb-active-record.inc.php.

Here is the caller graph for this function:

GetPrimaryKeys ( &$  db,
table 
)

Definition at line 533 of file adodb-active-recordx.inc.php.

hasMany ( foreignRef,
foreignKey = false,
foreignClass = 'ADODB_Active_Record' 
)

Definition at line 196 of file adodb-active-record.inc.php.

hasMany ( foreignRef,
foreignKey = false 
)

Definition at line 291 of file adodb-active-recordx.inc.php.

Here is the call graph for this function:

Insert ( )

Definition at line 733 of file adodb-active-record.inc.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Insert ( )

Definition at line 899 of file adodb-active-recordx.inc.php.

Here is the call graph for this function:

LastInsertID ( &$  db,
fieldname 
)

Definition at line 614 of file adodb-active-record.inc.php.

Here is the caller graph for this function:

LastInsertID ( &$  db,
fieldname 
)

Definition at line 692 of file adodb-active-recordx.inc.php.

Load ( where = null,
bindarr = false 
)

Definition at line 680 of file adodb-active-record.inc.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Load ( where = null,
bindarr = false 
)
Todo:
Improve by storing once and for all in table metadata
Todo:
Also re-use info for hasManyId

Definition at line 747 of file adodb-active-recordx.inc.php.

Here is the call graph for this function:

LoadRelations ( name,
whereOrderBy = '',
offset = -1,
limit = -1 
)
Parameters:
string$name
string$whereOrderBy: eg. ' AND field1 = value ORDER BY field2'
offset
limit
Returns:
mixed

Definition at line 286 of file adodb-active-record.inc.php.

Here is the call graph for this function:

Here is the caller graph for this function:

LoadRelations ( name,
whereOrderBy,
offset = -1,
limit = -1 
)

Definition at line 345 of file adodb-active-recordx.inc.php.

Here is the call graph for this function:

packageFind ( whereOrderBy,
bindarr = false,
pkeysArr = false,
extra = array() 
)

Definition at line 975 of file adodb-active-recordx.inc.php.

Here is the call graph for this function:

Reload ( )

Definition at line 557 of file adodb-active-record.inc.php.

Here is the call graph for this function:

Reload ( )

Definition at line 610 of file adodb-active-recordx.inc.php.

Here is the call graph for this function:

Replace ( )

Definition at line 804 of file adodb-active-record.inc.php.

Here is the call graph for this function:

Replace ( )

Definition at line 985 of file adodb-active-recordx.inc.php.

Here is the call graph for this function:

Reset ( )

Definition at line 706 of file adodb-active-record.inc.php.

Save ( )

Definition at line 723 of file adodb-active-record.inc.php.

Here is the call graph for this function:

Save ( )

Definition at line 883 of file adodb-active-recordx.inc.php.

Here is the call graph for this function:

Set ( &$  row)

Definition at line 567 of file adodb-active-record.inc.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Set ( &$  row)

Definition at line 620 of file adodb-active-recordx.inc.php.

Here is the call graph for this function:

static SetDatabaseAdapter ( &$  db,
index = false 
) [static]

Definition at line 98 of file adodb-active-record.inc.php.

Here is the call graph for this function:

Here is the caller graph for this function:

static SetDatabaseAdapter ( &$  db) [static]

Definition at line 109 of file adodb-active-recordx.inc.php.

Here is the call graph for this function:

static TableBelongsTo ( table,
foreignRef,
foreignKey = false,
parentKey = '',
parentClass = 'ADODB_Active_Record' 
) [static]

Definition at line 253 of file adodb-active-record.inc.php.

static TableHasMany ( table,
foreignRef,
foreignKey = false,
foreignClass = 'ADODB_Active_Record' 
) [static]

Definition at line 208 of file adodb-active-record.inc.php.

& TableInfo ( )

Definition at line 546 of file adodb-active-record.inc.php.

Here is the caller graph for this function:

& TableInfo ( )

Definition at line 598 of file adodb-active-recordx.inc.php.

static TableKeyBelongsTo ( table,
tablePKey,
foreignRef,
foreignKey = false,
parentKey = '',
parentClass = 'ADODB_Active_Record' 
) [static]

Definition at line 259 of file adodb-active-record.inc.php.

static TableKeyHasMany ( table,
tablePKey,
foreignRef,
foreignKey = false,
foreignClass = 'ADODB_Active_Record' 
) [static]

Definition at line 215 of file adodb-active-record.inc.php.

Update ( )

Definition at line 869 of file adodb-active-record.inc.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Update ( )

Definition at line 1047 of file adodb-active-recordx.inc.php.

Here is the call graph for this function:

UpdateActiveTable ( pkeys = false,
forceUpdate = false 
)

Definition at line 336 of file adodb-active-record.inc.php.

Here is the call graph for this function:

Here is the caller graph for this function:

UpdateActiveTable ( pkeys = false,
forceUpdate = false 
)

Definition at line 394 of file adodb-active-recordx.inc.php.

Here is the call graph for this function:

static UseDefaultValues ( bool = null) [static]

Definition at line 90 of file adodb-active-record.inc.php.

static UseDefaultValues ( bool = null) [static]

Definition at line 101 of file adodb-active-recordx.inc.php.


Field Documentation

static $_changeNames = true [static]

Definition at line 76 of file adodb-active-record.inc.php.

$_dbat

Definition at line 80 of file adodb-active-record.inc.php.

static $_foreignSuffix = '_id' [static]

Definition at line 79 of file adodb-active-record.inc.php.

$_lasterr = false

Definition at line 85 of file adodb-active-record.inc.php.

$_original = false

Definition at line 86 of file adodb-active-record.inc.php.

$_pTable

Definition at line 92 of file adodb-active-recordx.inc.php.

$_quoteNames = false [static]

Definition at line 77 of file adodb-active-record.inc.php.

$_saved = false

Definition at line 84 of file adodb-active-record.inc.php.

$_sTable

Definition at line 91 of file adodb-active-recordx.inc.php.

$_table

Definition at line 81 of file adodb-active-record.inc.php.

$_tableat

Definition at line 82 of file adodb-active-record.inc.php.

$_where

Definition at line 83 of file adodb-active-record.inc.php.

$foreignName

Definition at line 88 of file adodb-active-record.inc.php.

$IrregularP [static]
Initial value:
 array(
                'PERSON'    => 'people',
                'MAN'       => 'men',
                'WOMAN'     => 'women',
                'CHILD'     => 'children',
                'COW'       => 'kine',
        )

Definition at line 189 of file adodb-active-recordx.inc.php.

$IrregularS [static]
Initial value:
 array(
                'PEOPLE'    => 'PERSON',
                'MEN'       => 'man',
                'WOMEN'     => 'woman',
                'CHILDREN'  => 'child',
                'KINE'      => 'cow',
        )

Definition at line 197 of file adodb-active-recordx.inc.php.

$WeIsI [static]
Initial value:
 array(
                'EQUIPMENT' => true,
                'INFORMATION'   => true,
                'RICE'      => true,
                'MONEY'     => true,
                'SPECIES'   => true,
                'SERIES'    => true,
                'FISH'      => true,
                'SHEEP'     => true,
        )

Definition at line 205 of file adodb-active-recordx.inc.php.


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