ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilDclDatetimeFieldRepresentation.php
Go to the documentation of this file.
1<?php
2
19declare(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}
This class represents a date/time property in a property form.
setupInputField(ilFormPropertyGUI $input, ilDclBaseFieldModel $field)
Sets basic settings on field-input.
setupFilterInputField(?ilTableFilterItem $input)
Set basic settings for filter-input-gui.
getRecordFieldValue(?string $field_id)
Get Field Value.
getInputField(ilPropertyFormGUI $form, ?int $record_id=null)
Returns field-input.
addFilterInputFieldToTable(ilTable2GUI $table)
Add filter input to TableGUI.
passThroughFilter(ilDclBaseRecordModel $record, $filter)
This class represents a property form user interface.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
addFilterItemByMetaType(string $id, int $type=self::FILTER_TEXT, bool $a_optional=false, string $caption="")
Add filter by standard type.
const FILTER_DATETIME_RANGE