ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilDclDateFieldRepresentation.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 $this->setupInputField($input, $this->getField());
27
28 return $input;
29 }
30
31 public function addFilterInputFieldToTable(ilTable2GUI $table): ?array
32 {
33 $input = $table->addFilterItemByMetaType(
34 "filter_" . $this->getField()->getId(),
36 false,
37 $this->getField()->getId()
38 );
39 $input->setSubmitFormOnEnter(true);
40
41 $this->setupFilterInputField($input);
42
43 return $this->getFilterInputFieldValue($input);
44 }
45
49 public function passThroughFilter(ilDclBaseRecordModel $record, $filter): bool
50 {
51 $value = $record->getRecordFieldValue($this->getField()->getId());
52 if ((!$filter['from'] || $value >= $filter['from']) && (!$filter['to'] || $value <= $filter['to'])) {
53 return true;
54 }
55
56 return false;
57 }
58}
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.
passThroughFilter(ilDclBaseRecordModel $record, $filter)
addFilterInputFieldToTable(ilTable2GUI $table)
Add filter input to TableGUI.
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.