ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
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.
 getADT ()
 Get ADT.
 setTable ($a_table)
 Set table name.
 getTable ()
 Get table name.
 setElementId ($a_value)
 Set element id (aka DB column[s] [prefix])
 getElementId ()
 Get element id.
 setPrimary (array $a_value)
 Set primary fields (in MDB2 format)
 getPrimary ()
 Get primary fields.
 getActiveRecordFields ()
 Convert ADT to active record fields.
 getFieldValue ($a_field_name)
 Get field value.
 setFieldValue ($a_field_name, $a_field_value)
 Set field value.

Protected Member Functions

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

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

ilADTActiveRecordBridge::__construct ( ilADT  $a_adt)

Constructor.

Parameters
ilADT$a_adt
Returns
self

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

References setADT().

{
$this->setADT($a_adt);
}

+ Here is the call graph for this function:

Member Function Documentation

ilADTActiveRecordBridge::getActiveRecordFields ( )
abstract

Convert ADT to active record fields.

Returns
array

Reimplemented in ilADTGroupActiveRecordBridge, and ilADTTextActiveRecordBridge.

ilADTActiveRecordBridge::getADT ( )
ilADTActiveRecordBridge::getElementId ( )

Get element id.

Returns
string

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

References $id.

Referenced by ilADTTextActiveRecordBridge\getActiveRecordFields().

{
return $this->id;
}

+ Here is the caller graph for this function:

ilADTActiveRecordBridge::getFieldValue (   $a_field_name)
abstract

Get field value.

Parameters
string$a_field_name
Returns
mixed

Reimplemented in ilADTTextActiveRecordBridge.

ilADTActiveRecordBridge::getPrimary ( )

Get primary fields.

Returns
array

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

References $primary.

{
}
ilADTActiveRecordBridge::getTable ( )

Get table name.

Returns
string

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

{
return $this->table;
}
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

Reimplemented in ilADTGroupActiveRecordBridge, and ilADTTextActiveRecordBridge.

Referenced by setADT().

+ Here is the caller graph for this function:

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().

{
if(!$this->isValidADT($a_adt))
{
throw new Exception('ADTActiveRecordBridge Type mismatch.');
}
$this->adt = $a_adt;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilADTActiveRecordBridge::setElementId (   $a_value)

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

Parameters
string$a_value

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

{
$this->id = (string)$a_value;
}
ilADTActiveRecordBridge::setFieldValue (   $a_field_name,
  $a_field_value 
)
abstract

Set field value.

Parameters
string$a_field_name
mixed$a_field_value

Reimplemented in ilADTTextActiveRecordBridge.

ilADTActiveRecordBridge::setPrimary ( array  $a_value)

Set primary fields (in MDB2 format)

Parameters
array$a_value

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

{
$this->primary = $a_value;
}
ilADTActiveRecordBridge::setTable (   $a_table)

Set table name.

Parameters
string$a_table

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

{
$this->table = (string)$a_table;
}

Field Documentation

ilADTActiveRecordBridge::$adt
protected

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

Referenced by getADT().

ilADTActiveRecordBridge::$id
protected

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

Referenced by getElementId().

ilADTActiveRecordBridge::$primary
protected

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

Referenced by getPrimary().

ilADTActiveRecordBridge::$tabe
protected

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


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