ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilADTGroupDBBridge Class Reference
+ Inheritance diagram for ilADTGroupDBBridge:
+ Collaboration diagram for ilADTGroupDBBridge:

Public Member Functions

 getElements ()
 
 getElement ($a_element_id)
 
 setTable ($a_table)
 
 setPrimary (array $a_value)
 
 readRecord (array $a_row)
 
 prepareInsert (array &$a_fields)
 
 afterInsert ()
 
 afterUpdate ()
 
 afterDelete ()
 
- Public Member Functions inherited from ilADTDBBridge
 __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...
 
 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)
 Prepare ADT values for update. More...
 
 afterUpdate ()
 After update hook to enable sub-tables. More...
 
 afterDelete ()
 After delete hook to enable sub-tables. More...
 

Protected Member Functions

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

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

◆ afterDelete()

ilADTGroupDBBridge::afterDelete ( )

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

References getElements().

117  {
118  foreach($this->getElements() as $element)
119  {
120  $element->afterDelete();
121  }
122  }
+ Here is the call graph for this function:

◆ afterInsert()

ilADTGroupDBBridge::afterInsert ( )

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

References getElements().

101  {
102  foreach($this->getElements() as $element)
103  {
104  $element->afterInsert();
105  }
106  }
+ Here is the call graph for this function:

◆ afterUpdate()

ilADTGroupDBBridge::afterUpdate ( )

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

References getElements().

109  {
110  foreach($this->getElements() as $element)
111  {
112  $element->afterUpdate();
113  }
114  }
+ Here is the call graph for this function:

◆ getElement()

ilADTGroupDBBridge::getElement (   $a_element_id)

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

References getElements().

45  {
46  if(array_key_exists($a_element_id, $this->getElements()))
47  {
48  return $this->elements[$a_element_id];
49  }
50  }
+ Here is the call graph for this function:

◆ getElements()

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isValidADT()

ilADTGroupDBBridge::isValidADT ( ilADT  $a_adt)
protected

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

10  {
11  return ($a_adt instanceof ilADTGroup);
12  }

◆ prepareElements()

ilADTGroupDBBridge::prepareElements ( )
protected

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

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

Referenced by getElements().

18  {
19  if(sizeof($this->elements))
20  {
21  return;
22  }
23 
24  $this->elements = array();
25  $factory = ilADTFactory::getInstance();
26 
27  // convert ADTs to DB bridges
28 
29  foreach($this->getADT()->getElements() as $name => $element)
30  {
31  $this->elements[$name] = $factory->getDBBridgeForInstance($element);
32  $this->elements[$name]->setElementId($name);
33  $this->elements[$name]->setTable($this->getTable());
34  $this->elements[$name]->setPrimary($this->getPrimary());
35  }
36  }
getTable()
Get table name.
getPrimary()
Get primary fields.
static getInstance()
Get singleton.
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ prepareInsert()

ilADTGroupDBBridge::prepareInsert ( array $a_fields)

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

References getElements().

93  {
94  foreach($this->getElements() as $element)
95  {
96  $element->prepareInsert($a_fields);
97  }
98  }
+ Here is the call graph for this function:

◆ readRecord()

ilADTGroupDBBridge::readRecord ( array  $a_row)

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

References getElements().

85  {
86  foreach($this->getElements() as $element)
87  {
88  $element->readRecord($a_row);
89  }
90  }
+ Here is the call graph for this function:

◆ setPrimary()

ilADTGroupDBBridge::setPrimary ( array  $a_value)

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

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

Referenced by ilADTTest\initDBBridge().

69  {
70  parent::setPrimary($a_value);
71 
72  if(sizeof($this->elements))
73  {
74  foreach(array_keys($this->getADT()->getElements()) as $name)
75  {
76  $this->elements[$name]->setPrimary($this->getPrimary());
77  }
78  }
79  }
getPrimary()
Get primary fields.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setTable()

ilADTGroupDBBridge::setTable (   $a_table)

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

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

Referenced by ilADTTest\initDBBridge().

56  {
57  parent::setTable($a_table);
58 
59  if(sizeof($this->elements))
60  {
61  foreach(array_keys($this->getADT()->getElements()) as $name)
62  {
63  $this->elements[$name]->setTable($this->getTable());
64  }
65  }
66  }
getTable()
Get table name.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $elements

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: