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

Public Member Functions

 readRecord (array $a_row)
 Import DB values to ADT.
 prepareInsert (array &$a_fields)
 Prepare ADT values for insert.
- Public Member Functions inherited from ilADTDBBridge
 __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.
 buildPrimaryWhere ()
 Convert primary keys array to sql string.
 afterInsert ()
 After insert hook to enable sub-tables.
 prepareUpdate (array &$a_fields)
 Prepare ADT values for update.
 afterUpdate ()
 After update hook to enable sub-tables.
 afterDelete ()
 After delete hook to enable sub-tables.

Protected Member Functions

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

Additional Inherited Members

- Protected Attributes inherited from ilADTDBBridge
 $adt
 $table
 $id
 $primary

Detailed Description

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

Member Function Documentation

ilADTDateDBBridge::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.ilADTDateDBBridge.php.

{
return ($a_adt instanceof ilADTDate);
}
ilADTDateDBBridge::prepareInsert ( array &  $a_fields)

Prepare ADT values for insert.

Parameters
array&$a_fields

Reimplemented from ilADTDBBridge.

Definition at line 24 of file class.ilADTDateDBBridge.php.

References ilADTDBBridge\getADT(), ilADTDBBridge\getElementId(), and IL_CAL_DATE.

{
$date = $this->getADT()->getDate();
if($date instanceof ilDate)
{
$date = $date->get(IL_CAL_DATE);
}
$a_fields[$this->getElementId()] = array("date", $date);
}

+ Here is the call graph for this function:

ilADTDateDBBridge::readRecord ( array  $a_row)

Import DB values to ADT.

Parameters
array$a_row

Reimplemented from ilADTDBBridge.

Definition at line 14 of file class.ilADTDateDBBridge.php.

References ilADTDBBridge\getADT(), ilADTDBBridge\getElementId(), and IL_CAL_DATE.

{
$date = null;
if($a_row[$this->getElementId()])
{
$date = new ilDate($a_row[$this->getElementId()], IL_CAL_DATE);
}
$this->getADT()->setDate($date);
}

+ Here is the call graph for this function:


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