ILIAS  trunk Revision v11.0_alpha-2662-g519ff7d528f
class.ilDclDatetimeFieldRepresentation.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 {
23  public function getInputField(ilPropertyFormGUI $form, ?int $record_id = null): ilDateTimeInputGUI
24  {
25  $input = new ilDateTimeInputGUI($this->getField()->getTitle(), 'field_' . $this->getField()->getId());
26  $input->setShowTime(true);
27  $this->setupInputField($input, $this->getField());
28 
29  return $input;
30  }
31 
32  public function addFilterInputFieldToTable(ilTable2GUI $table): ?array
33  {
34  $input = $table->addFilterItemByMetaType(
35  "filter_" . $this->getField()->getId(),
37  false,
38  $this->getField()->getId()
39  );
40  $input->setSubmitFormOnEnter(true);
41 
42  $this->setupFilterInputField($input);
43 
44  return $this->getFilterInputFieldValue($input);
45  }
46 
50  public function passThroughFilter(ilDclBaseRecordModel $record, $filter): bool
51  {
52  $value = $record->getRecordFieldValue($this->getField()->getId());
53  if ((!$filter['from'] || $value >= $filter['from']) && (!$filter['to'] || $value <= $filter['to'])) {
54  return true;
55  }
56 
57  return false;
58  }
59 }
getRecordFieldValue(?string $field_id)
Get Field Value.
getInputField(ilPropertyFormGUI $form, ?int $record_id=null)
This class represents a date/time property in a property form.
setupInputField(ilFormPropertyGUI $input, ilDclBaseFieldModel $field)
Sets basic settings on field-input.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
addFilterItemByMetaType(string $id, int $type=self::FILTER_TEXT, bool $a_optional=false, string $caption="")
Add filter by standard type.
const FILTER_DATETIME_RANGE
setupFilterInputField(?ilTableFilterItem $input)
Set basic settings for filter-input-gui.
passThroughFilter(ilDclBaseRecordModel $record, $filter)