ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilADTDateTimeDBBridge Class Reference
+ Inheritance diagram for ilADTDateTimeDBBridge:
+ Collaboration diagram for ilADTDateTimeDBBridge:

Public Member Functions

 readRecord (array $a_row)
 
 prepareInsert (array &$a_fields)
 
- 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)
 
- Protected Member Functions inherited from ilADTDBBridge
 isValidADT (ilADT $a_adt)
 Check if given ADT is valid. More...
 
 setADT (ilADT $a_adt)
 Set ADT. More...
 

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

◆ isValidADT()

ilADTDateTimeDBBridge::isValidADT ( ilADT  $a_adt)
protected

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

8  {
9  return ($a_adt instanceof ilADTDateTime);
10  }

◆ prepareInsert()

ilADTDateTimeDBBridge::prepareInsert ( array &  $a_fields)

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

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

24  {
25  $date = $this->getADT()->getDate();
26  if ($date instanceof ilDateTime) {
27  $date = $date->get(IL_CAL_DATETIME);
28  }
29  $a_fields[$this->getElementId()] = array("timestamp", $date);
30  }
const IL_CAL_DATETIME
getElementId()
Get element id.
Date and time handling
+ Here is the call graph for this function:

◆ readRecord()

ilADTDateTimeDBBridge::readRecord ( array  $a_row)

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

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

15  {
16  $date = null;
17  if ($a_row[$this->getElementId()]) {
18  $date = new ilDateTime($a_row[$this->getElementId()], IL_CAL_DATETIME);
19  }
20  $this->getADT()->setDate($date);
21  }
const IL_CAL_DATETIME
getElementId()
Get element id.
Date and time handling
+ Here is the call graph for this function:

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