ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 105 of file class.ilADTGroupDBBridge.php.

References getElements().

106  {
107  foreach ($this->getElements() as $element) {
108  $element->afterDelete();
109  }
110  }
+ Here is the call graph for this function:

◆ afterInsert()

ilADTGroupDBBridge::afterInsert ( )

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

References getElements().

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

◆ afterUpdate()

ilADTGroupDBBridge::afterUpdate ( )

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

References getElements().

99  {
100  foreach ($this->getElements() as $element) {
101  $element->afterUpdate();
102  }
103  }
+ Here is the call graph for this function:

◆ getElement()

ilADTGroupDBBridge::getElement (   $a_element_id)

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

References getElements().

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

◆ getElements()

ilADTGroupDBBridge::getElements ( )

Definition at line 36 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 $factory, $name, array, ilADTDBBridge\getADT(), getElements(), ilADTFactory\getInstance(), ilADTDBBridge\getPrimary(), and ilADTDBBridge\getTable().

Referenced by getElements().

18  {
19  if (sizeof($this->elements)) {
20  return;
21  }
22 
23  $this->elements = array();
25 
26  // convert ADTs to DB bridges
27 
28  foreach ($this->getADT()->getElements() as $name => $element) {
29  $this->elements[$name] = $factory->getDBBridgeForInstance($element);
30  $this->elements[$name]->setElementId($name);
31  $this->elements[$name]->setTable($this->getTable());
32  $this->elements[$name]->setPrimary($this->getPrimary());
33  }
34  }
$factory
Definition: metadata.php:47
getTable()
Get table name.
getPrimary()
Get primary fields.
static getInstance()
Get singleton.
if($format !==null) $name
Definition: metadata.php:146
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 84 of file class.ilADTGroupDBBridge.php.

References getElements().

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

◆ readRecord()

ilADTGroupDBBridge::readRecord ( array  $a_row)

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

References getElements().

78  {
79  foreach ($this->getElements() as $element) {
80  $element->readRecord($a_row);
81  }
82  }
+ Here is the call graph for this function:

◆ setPrimary()

ilADTGroupDBBridge::setPrimary ( array  $a_value)

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

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

Referenced by ilADTTest\initDBBridge().

64  {
65  parent::setPrimary($a_value);
66 
67  if (sizeof($this->elements)) {
68  foreach (array_keys($this->getADT()->getElements()) as $name) {
69  $this->elements[$name]->setPrimary($this->getPrimary());
70  }
71  }
72  }
getPrimary()
Get primary fields.
if($format !==null) $name
Definition: metadata.php:146
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setTable()

ilADTGroupDBBridge::setTable (   $a_table)

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

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

Referenced by ilADTTest\initDBBridge().

53  {
54  parent::setTable($a_table);
55 
56  if (sizeof($this->elements)) {
57  foreach (array_keys($this->getADT()->getElements()) as $name) {
58  $this->elements[$name]->setTable($this->getTable());
59  }
60  }
61  }
getTable()
Get table name.
if($format !==null) $name
Definition: metadata.php:146
+ 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: