ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilADTMultiDBBridge Class Reference
+ Inheritance diagram for ilADTMultiDBBridge:
+ Collaboration diagram for ilADTMultiDBBridge:

Public Member Functions

 readRecord (array $a_row)
 
 prepareInsert (array &$a_fields)
 
 afterInsert ()
 
 afterUpdate ()
 
 afterDelete ()
 
- Public Member Functions inherited from ilADTDBBridge
 __construct (ilADT $a_adt)
 Constructor. More...
 
 getADT ()
 
 setTable (string $a_table)
 
 getTable ()
 
 setElementId (string $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...
 
 getAdditionalPrimaryFields ()
 
 getPrimary ()
 Get primary fields. More...
 
 buildPrimaryWhere ()
 Convert primary keys array to sql string. More...
 
 readRecord (array $a_row)
 Import DB values to ADT. More...
 
 prepareInsert (array &$a_fields)
 Prepare ADT values for insert. More...
 
 afterInsert ()
 After insert hook to enable sub-tables. More...
 
 prepareUpdate (array &$a_fields)
 
 afterUpdate ()
 After update hook to enable sub-tables. More...
 
 afterDelete ()
 After delete hook to enable sub-tables. More...
 
 supportsDefaultValueColumn ()
 true if table storage relies on the default 'value' column More...
 

Protected Member Functions

 getSubTableName ()
 Build sub-table name. More...
 
 readMultiRecord (ilDBStatement $a_set)
 Import record-rows from sub-table. More...
 
 prepareMultiInsert ()
 Build insert-fields for each "value". More...
 
- Protected Member Functions inherited from ilADTDBBridge
 isValidADT (ilADT $a_adt)
 
 setADT (ilADT $a_adt)
 

Additional Inherited Members

- Protected Attributes inherited from ilADTDBBridge
ilADT $adt
 
string $table
 
string $id
 
array $primary = []
 
ilDBInterface $db
 

Detailed Description

Definition at line 21 of file class.ilADTMultiDBBridge.php.

Member Function Documentation

◆ afterDelete()

ilADTMultiDBBridge::afterDelete ( )

Definition at line 78 of file class.ilADTMultiDBBridge.php.

78  : void
79  {
80  // is this in use? Cannot
81  /*
82  $ilDB->manipulate("DELETE FROM " . $this->getSubTableName() .
83  " WHERE " . $this->buildPrimaryWhere());
84  */
85  }

◆ afterInsert()

ilADTMultiDBBridge::afterInsert ( )

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

References afterUpdate().

52  : void
53  {
54  $this->afterUpdate();
55  }
+ Here is the call graph for this function:

◆ afterUpdate()

ilADTMultiDBBridge::afterUpdate ( )

Definition at line 57 of file class.ilADTMultiDBBridge.php.

References prepareMultiInsert().

Referenced by afterInsert().

57  : void
58  {
59  // :TODO: build diff, save difference
60  // is this in use? Cannot
61  /*
62  $ilDB->manipulate("DELETE FROM " . $this->getSubTableName() .
63  " WHERE " . $this->buildPrimaryWhere());
64 
65  foreach ($this->prepareMultiInsert() as $sub_items) {
66  $fields = array_merge($this->getPrimary(), $sub_items);
67 
68  $ilDB->insert($this->getSubTableName(), $fields);
69  }
70  */
71  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSubTableName()

ilADTMultiDBBridge::getSubTableName ( )
protected

Build sub-table name.

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

References ilADTDBBridge\getElementId(), and ilADTDBBridge\getTable().

Referenced by readRecord().

26  : string
27  {
28  // getElementId? => adv_md_values_enum_123
29  return $this->getTable() . "_" . $this->getElementId();
30  }
getElementId()
Get element id.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ prepareInsert()

ilADTMultiDBBridge::prepareInsert ( array &  $a_fields)

Definition at line 47 of file class.ilADTMultiDBBridge.php.

47  : void
48  {
49  // see afterUpdate()
50  }

◆ prepareMultiInsert()

ilADTMultiDBBridge::prepareMultiInsert ( )
abstractprotected

Build insert-fields for each "value".

Referenced by afterUpdate().

+ Here is the caller graph for this function:

◆ readMultiRecord()

ilADTMultiDBBridge::readMultiRecord ( ilDBStatement  $a_set)
abstractprotected

Import record-rows from sub-table.

Parameters
object$a_set

Referenced by readRecord().

+ Here is the caller graph for this function:

◆ readRecord()

ilADTMultiDBBridge::readRecord ( array  $a_row)

Definition at line 32 of file class.ilADTMultiDBBridge.php.

References ilADTDBBridge\buildPrimaryWhere(), ilADTDBBridge\getElementId(), getSubTableName(), and readMultiRecord().

32  : void
33  {
34  $sql = "SELECT " . $this->getElementId() .
35  " FROM " . $this->getSubTableName() .
36  " WHERE " . $this->buildPrimaryWhere();
37  $set = $this->db->query($sql);
38  $this->readMultiRecord($set);
39  }
buildPrimaryWhere()
Convert primary keys array to sql string.
getSubTableName()
Build sub-table name.
getElementId()
Get element id.
readMultiRecord(ilDBStatement $a_set)
Import record-rows from sub-table.
+ Here is the call graph for this function:

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