ILIAS  trunk Revision v11.0_alpha-1723-g8e69f309bab
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
class.ilADTDateTimeDBBridge.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 {
23  protected function isValidADT(ilADT $a_adt): bool
24  {
25  return ($a_adt instanceof ilADTDateTime);
26  }
27 
28  // CRUD
29 
30  public function readRecord(array $a_row): void
31  {
32  $date = null;
33  if ($a_row[$this->getElementId()]) {
34  $date = new ilDateTime($a_row[$this->getElementId()], IL_CAL_DATETIME);
35  }
36  $this->getADT()->setDate($date);
37  }
38 
39  public function prepareInsert(array &$a_fields): void
40  {
41  $date = $this->getADT()->getDate();
42  if ($date instanceof ilDateTime) {
43  $date = $date->get(IL_CAL_DATETIME);
44  }
45  $a_fields[$this->getElementId()] = array("timestamp", $date);
46  }
47 }
const IL_CAL_DATETIME
getElementId()
Get element id.
ADT base class.
Definition: class.ilADT.php:25
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
ADT DB bridge base class.