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

Protected Member Functions

 isValidADT (ilADT $a_adt)
 Check if given ADT is valid.
 readMultiRecord ($a_set)
 Import record-rows from sub-table.
 prepareMultiInsert ()
 Build insert-fields for each "value".
- Protected Member Functions inherited from ilADTMultiDBBridge
 getSubTableName ()
 Build sub-table name.
- Protected Member Functions inherited from ilADTDBBridge
 setADT (ilADT $a_adt)
 Set ADT.

Additional Inherited Members

- Public Member Functions inherited from ilADTMultiDBBridge
 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.
- Protected Attributes inherited from ilADTDBBridge
 $adt
 $table
 $id
 $primary

Detailed Description

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

Member Function Documentation

ilADTMultiTextDBBridge::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 7 of file class.ilADTMultiTextDBBridge.php.

{
return ($a_adt instanceof ilADTMultiText);
}
ilADTMultiTextDBBridge::prepareMultiInsert ( )
protected

Build insert-fields for each "value".

Returns
array

Reimplemented from ilADTMultiDBBridge.

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

References $res, ilADTDBBridge\getADT(), and ilADTDBBridge\getElementId().

{
$res = array();
foreach((array)$this->getADT()->getTextElements() as $element)
{
$res[] = array($this->getElementId() => array("text", $element));
}
return $res;
}

+ Here is the call graph for this function:

ilADTMultiTextDBBridge::readMultiRecord (   $a_set)
protected

Import record-rows from sub-table.

Parameters
object$a_set

Reimplemented from ilADTMultiDBBridge.

Definition at line 12 of file class.ilADTMultiTextDBBridge.php.

References $ilDB, $row, ilADTDBBridge\getADT(), and ilADTDBBridge\getElementId().

{
global $ilDB;
$elements = array();
while($row = $ilDB->fetchAssoc($a_set))
{
$elements[] = $row[$this->getElementId()];
}
$this->getADT()->setTextElements($elements);
}

+ Here is the call graph for this function:


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