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

Public Member Functions

 getElements ()
 getElement ($a_element_id)
 getActiveRecordFields ()
 Convert ADT to active record fields.
- Public Member Functions inherited from ilADTActiveRecordBridge
 __construct (ilADT $a_adt)
 Constructor.
 getADT ()
 Get ADT.
 setTable ($a_table)
 Set table name.
 getTable ()
 Get table name.
 setElementId ($a_value)
 Set element id (aka DB column[s] [prefix])
 getElementId ()
 Get element id.
 setPrimary (array $a_value)
 Set primary fields (in MDB2 format)
 getPrimary ()
 Get primary fields.
 getFieldValue ($a_field_name)
 Get field value.
 setFieldValue ($a_field_name, $a_field_value)
 Set field value.

Protected Member Functions

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

Protected Attributes

 $elements
- Protected Attributes inherited from ilADTActiveRecordBridge
 $adt
 $id
 $tabe
 $primary

Detailed Description

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

Member Function Documentation

ilADTGroupActiveRecordBridge::getActiveRecordFields ( )

Convert ADT to active record fields.

Returns
array

Reimplemented from ilADTActiveRecordBridge.

Definition at line 54 of file class.ilADTGroupActiveRecordBridge.php.

References getElements().

{
$fields = array();
foreach($this->getElements() as $element_id => $element)
{
$element_fields = $element->getActiveRecordFields();
if($element_fields)
{
$fields[$element_id] = $element_fields;
}
}
return $fields;
}

+ Here is the call graph for this function:

ilADTGroupActiveRecordBridge::getElement (   $a_element_id)

Definition at line 42 of file class.ilADTGroupActiveRecordBridge.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:

ilADTGroupActiveRecordBridge::getElements ( )

Definition at line 36 of file class.ilADTGroupActiveRecordBridge.php.

References $elements, and prepareElements().

Referenced by getActiveRecordFields(), getElement(), and prepareElements().

{
$this->prepareElements();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilADTGroupActiveRecordBridge::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 ilADTActiveRecordBridge.

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

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

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

References ilADTActiveRecordBridge\getADT(), getElements(), and ilADTFactory\getInstance().

Referenced by getElements().

{
if(sizeof($this->elements))
{
return;
}
$this->elements = array();
// convert ADTs to ActiveRecord bridges
foreach($this->getADT()->getElements() as $name => $element)
{
$this->elements[$name] = $factory->getActiveRecordBridgeForInstance($element);
$this->elements[$name]->setElementId($name);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

ilADTGroupActiveRecordBridge::$elements
protected

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

Referenced by getElements().


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