Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
ADODB_Active_Record Class Reference

Public Member Functions

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

Static Public Member Functions

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

Public Attributes

 $_dbat
 
 $_lasterr = false
 
 $_original = false
 
 $_pTable
 
bool string $_quoteNames
 Allows override of global $ADODB_QUOTE_FIELDNAMES.
 
 $_saved = false
 
 $_sTable
 
 $_table
 
 $_tableat
 
 $_where
 
 $foreignName
 
 $lockMode = ' for update '
 

Static Public Attributes

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

Protected Member Functions

 __get ($name)
 __get Access properties - used for lazy loading
 
 __get ($name)
 __get Access properties - used for lazy loading
 

Member Function Documentation

◆ __get() [1/2]

ADODB_Active_Record::__get ( $name)
protected

__get Access properties - used for lazy loading

Parameters
mixed$name
Return values
mixed

◆ __get() [2/2]

ADODB_Active_Record::__get ( $name)
protected

__get Access properties - used for lazy loading

Parameters
mixed$name
Return values
void

◆ belongsTo()

ADODB_Active_Record::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

◆ LoadRelations()

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

Member Data Documentation

◆ $IrregularP

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

◆ $IrregularS

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

◆ $WeIsI

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

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