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

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.ilADTDateTimeDBBridge.php.

Member Function Documentation

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

{
return ($a_adt instanceof ilADTDateTime);
}
ilADTDateTimeDBBridge::prepareInsert ( array &  $a_fields)

Prepare ADT values for insert.

Parameters
array&$a_fields

Reimplemented from ilADTDBBridge.

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

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

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

+ Here is the call graph for this function:

ilADTDateTimeDBBridge::readRecord ( array  $a_row)

Import DB values to ADT.

Parameters
array$a_row

Reimplemented from ilADTDBBridge.

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

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

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

+ Here is the call graph for this function:


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