ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilADTActiveRecordBridge Class Reference

ADT DB bridge base class. More...

+ Inheritance diagram for ilADTActiveRecordBridge:
+ Collaboration diagram for ilADTActiveRecordBridge:

Public Member Functions

 __construct (ilADT $a_adt)
 Constructor. More...
 
 getADT ()
 Get ADT. More...
 
 setTable ($a_table)
 Set table name. More...
 
 getTable ()
 Get table name. More...
 
 setElementId ($a_value)
 Set element id (aka DB column[s] [prefix]) More...
 
 getElementId ()
 Get element id. More...
 
 setPrimary (array $a_value)
 Set primary fields (in MDB2 format) More...
 
 getPrimary ()
 Get primary fields. More...
 
 getActiveRecordFields ()
 Convert ADT to active record fields. More...
 
 getFieldValue ($a_field_name)
 Get field value. More...
 
 setFieldValue ($a_field_name, $a_field_value)
 Set field value. More...
 

Protected Member Functions

 isValidADT (ilADT $a_adt)
 Check if given ADT is valid. More...
 
 setADT (ilADT $a_adt)
 Set ADT. More...
 

Protected Attributes

 $adt
 
 $id
 
 $tabe
 
 $primary = []
 

Detailed Description

ADT DB bridge base class.

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

Definition at line 13 of file class.ilADTActiveRecordBridge.php.

Constructor & Destructor Documentation

◆ __construct()

ilADTActiveRecordBridge::__construct ( ilADT  $a_adt)

Constructor.

Parameters
ilADT$a_adt
Returns
self

Definition at line 26 of file class.ilADTActiveRecordBridge.php.

References isValidADT(), and setADT().

27  {
28  $this->setADT($a_adt);
29  }
+ Here is the call graph for this function:

Member Function Documentation

◆ getActiveRecordFields()

ilADTActiveRecordBridge::getActiveRecordFields ( )
abstract

Convert ADT to active record fields.

Returns
array

Referenced by getPrimary().

+ Here is the caller graph for this function:

◆ getADT()

ilADTActiveRecordBridge::getADT ( )

◆ getElementId()

ilADTActiveRecordBridge::getElementId ( )

Get element id.

Returns
string

Definition at line 106 of file class.ilADTActiveRecordBridge.php.

References $id.

Referenced by ilADTTextActiveRecordBridge\getActiveRecordFields().

+ Here is the caller graph for this function:

◆ getFieldValue()

ilADTActiveRecordBridge::getFieldValue (   $a_field_name)
abstract

Get field value.

Parameters
string$a_field_name
Returns
mixed

Referenced by getPrimary().

+ Here is the caller graph for this function:

◆ getPrimary()

ilADTActiveRecordBridge::getPrimary ( )

Get primary fields.

Returns
array

Definition at line 126 of file class.ilADTActiveRecordBridge.php.

References $primary, getActiveRecordFields(), getFieldValue(), and setFieldValue().

+ Here is the call graph for this function:

◆ getTable()

ilADTActiveRecordBridge::getTable ( )

Get table name.

Returns
string

Definition at line 86 of file class.ilADTActiveRecordBridge.php.

References $table.

87  {
88  return $this->table;
89  }
if(empty($password)) $table
Definition: pwgen.php:24

◆ isValidADT()

ilADTActiveRecordBridge::isValidADT ( ilADT  $a_adt)
abstractprotected

Check if given ADT is valid.

:TODO: This could be avoided with type-specifc constructors :TODO: bridge base class?

Parameters
ilADT$a_adt

Referenced by __construct(), and setADT().

+ Here is the caller graph for this function:

◆ setADT()

ilADTActiveRecordBridge::setADT ( ilADT  $a_adt)
protected

Set ADT.

Exceptions
Exception
Parameters
ilADT$a_adt

Definition at line 52 of file class.ilADTActiveRecordBridge.php.

References isValidADT().

Referenced by __construct().

53  {
54  if (!$this->isValidADT($a_adt)) {
55  throw new Exception('ADTActiveRecordBridge Type mismatch.');
56  }
57 
58  $this->adt = $a_adt;
59  }
isValidADT(ilADT $a_adt)
Check if given ADT is valid.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setElementId()

ilADTActiveRecordBridge::setElementId (   $a_value)

Set element id (aka DB column[s] [prefix])

Parameters
string$a_value

Definition at line 96 of file class.ilADTActiveRecordBridge.php.

References string.

97  {
98  $this->id = (string) $a_value;
99  }
Add rich text string

◆ setFieldValue()

ilADTActiveRecordBridge::setFieldValue (   $a_field_name,
  $a_field_value 
)
abstract

Set field value.

Parameters
string$a_field_name
mixed$a_field_value

Referenced by getPrimary().

+ Here is the caller graph for this function:

◆ setPrimary()

ilADTActiveRecordBridge::setPrimary ( array  $a_value)

Set primary fields (in MDB2 format)

Parameters
array$a_value

Definition at line 116 of file class.ilADTActiveRecordBridge.php.

117  {
118  $this->primary = $a_value;
119  }

◆ setTable()

ilADTActiveRecordBridge::setTable (   $a_table)

Set table name.

Parameters
string$a_table

Definition at line 76 of file class.ilADTActiveRecordBridge.php.

References string.

77  {
78  $this->table = (string) $a_table;
79  }
Add rich text string

Field Documentation

◆ $adt

ilADTActiveRecordBridge::$adt
protected

Definition at line 15 of file class.ilADTActiveRecordBridge.php.

Referenced by getADT().

◆ $id

ilADTActiveRecordBridge::$id
protected

Definition at line 16 of file class.ilADTActiveRecordBridge.php.

Referenced by getElementId().

◆ $primary

ilADTActiveRecordBridge::$primary = []
protected

Definition at line 18 of file class.ilADTActiveRecordBridge.php.

Referenced by getPrimary().

◆ $tabe

ilADTActiveRecordBridge::$tabe
protected

Definition at line 17 of file class.ilADTActiveRecordBridge.php.


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