ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilADTGroupDBBridge Class Reference
+ Inheritance diagram for ilADTGroupDBBridge:
+ Collaboration diagram for ilADTGroupDBBridge:

Public Member Functions

 getElements ()
 getElement ($a_element_id)
 setTable ($a_table)
 Set table name.
 setPrimary (array $a_value)
 Set primary fields (in MDB2 format)
 readRecord (array $a_row)
 Import DB values to ADT.
 prepareInsert (array &$a_fields)
 Prepare ADT values for insert.
 afterInsert ()
 After insert hook to enable sub-tables.
 afterUpdate ()
 After update hook to enable sub-tables.
 afterDelete ()
 After delete hook to enable sub-tables.
- Public Member Functions inherited from ilADTDBBridge
 __construct (ilADT $a_adt)
 Constructor.
 getADT ()
 Get ADT.
 getTable ()
 Get table name.
 setElementId ($a_value)
 Set element id (aka DB column[s] [prefix])
 getElementId ()
 Get element id.
 getPrimary ()
 Get primary fields.
 buildPrimaryWhere ()
 Convert primary keys array to sql string.
 prepareUpdate (array &$a_fields)
 Prepare ADT values for update.

Protected Member Functions

 isValidADT (ilADT $a_adt)
 Check if given ADT is valid.
 prepareElements ()
- Protected Member Functions inherited from ilADTDBBridge
 setADT (ilADT $a_adt)
 Set ADT.

Protected Attributes

 $elements
- Protected Attributes inherited from ilADTDBBridge
 $adt
 $table
 $id
 $primary

Detailed Description

Definition at line 5 of file class.ilADTGroupDBBridge.php.

Member Function Documentation

ilADTGroupDBBridge::afterDelete ( )

After delete hook to enable sub-tables.

Reimplemented from ilADTDBBridge.

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

References getElements().

{
foreach($this->getElements() as $element)
{
$element->afterDelete();
}
}

+ Here is the call graph for this function:

ilADTGroupDBBridge::afterInsert ( )

After insert hook to enable sub-tables.

Reimplemented from ilADTDBBridge.

Definition at line 100 of file class.ilADTGroupDBBridge.php.

References getElements().

{
foreach($this->getElements() as $element)
{
$element->afterInsert();
}
}

+ Here is the call graph for this function:

ilADTGroupDBBridge::afterUpdate ( )

After update hook to enable sub-tables.

Reimplemented from ilADTDBBridge.

Definition at line 108 of file class.ilADTGroupDBBridge.php.

References getElements().

{
foreach($this->getElements() as $element)
{
$element->afterUpdate();
}
}

+ Here is the call graph for this function:

ilADTGroupDBBridge::getElement (   $a_element_id)

Definition at line 44 of file class.ilADTGroupDBBridge.php.

References getElements().

{
if(array_key_exists($a_element_id, $this->getElements()))
{
return $this->elements[$a_element_id];
}
}

+ Here is the call graph for this function:

ilADTGroupDBBridge::getElements ( )

Definition at line 38 of file class.ilADTGroupDBBridge.php.

References $elements, and prepareElements().

Referenced by afterDelete(), afterInsert(), afterUpdate(), getElement(), prepareElements(), prepareInsert(), readRecord(), setPrimary(), and setTable().

{
$this->prepareElements();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilADTGroupDBBridge::isValidADT ( ilADT  $a_adt)
protected

Check if given ADT is valid.

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

Parameters
ilADT$a_adt

Reimplemented from ilADTDBBridge.

Definition at line 9 of file class.ilADTGroupDBBridge.php.

{
return ($a_adt instanceof ilADTGroup);
}
ilADTGroupDBBridge::prepareElements ( )
protected

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

References ilADTDBBridge\getADT(), getElements(), ilADTFactory\getInstance(), ilADTDBBridge\getPrimary(), and ilADTDBBridge\getTable().

Referenced by getElements().

{
if(sizeof($this->elements))
{
return;
}
$this->elements = array();
// convert ADTs to DB bridges
foreach($this->getADT()->getElements() as $name => $element)
{
$this->elements[$name] = $factory->getDBBridgeForInstance($element);
$this->elements[$name]->setElementId($name);
$this->elements[$name]->setTable($this->getTable());
$this->elements[$name]->setPrimary($this->getPrimary());
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilADTGroupDBBridge::prepareInsert ( array &  $a_fields)

Prepare ADT values for insert.

Parameters
array&$a_fields

Reimplemented from ilADTDBBridge.

Definition at line 92 of file class.ilADTGroupDBBridge.php.

References getElements().

{
foreach($this->getElements() as $element)
{
$element->prepareInsert($a_fields);
}
}

+ Here is the call graph for this function:

ilADTGroupDBBridge::readRecord ( array  $a_row)

Import DB values to ADT.

Parameters
array$a_row

Reimplemented from ilADTDBBridge.

Definition at line 84 of file class.ilADTGroupDBBridge.php.

References getElements().

{
foreach($this->getElements() as $element)
{
$element->readRecord($a_row);
}
}

+ Here is the call graph for this function:

ilADTGroupDBBridge::setPrimary ( array  $a_value)

Set primary fields (in MDB2 format)

Parameters
array$a_value

Reimplemented from ilADTDBBridge.

Definition at line 68 of file class.ilADTGroupDBBridge.php.

References ilADTDBBridge\getADT(), getElements(), and ilADTDBBridge\getPrimary().

Referenced by ilADTTest\initDBBridge().

{
parent::setPrimary($a_value);
if(sizeof($this->elements))
{
foreach(array_keys($this->getADT()->getElements()) as $name)
{
$this->elements[$name]->setPrimary($this->getPrimary());
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilADTGroupDBBridge::setTable (   $a_table)

Set table name.

Parameters
string$a_table

Reimplemented from ilADTDBBridge.

Definition at line 55 of file class.ilADTGroupDBBridge.php.

References ilADTDBBridge\getADT(), getElements(), and ilADTDBBridge\getTable().

Referenced by ilADTTest\initDBBridge().

{
parent::setTable($a_table);
if(sizeof($this->elements))
{
foreach(array_keys($this->getADT()->getElements()) as $name)
{
$this->elements[$name]->setTable($this->getTable());
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

ilADTGroupDBBridge::$elements
protected

Definition at line 7 of file class.ilADTGroupDBBridge.php.

Referenced by getElements().


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