ILIAS  trunk Revision v11.0_alpha-2645-g16283d3b3f8
class.ilDclDateFieldRepresentation.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  $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 }
getInputField(ilPropertyFormGUI $form, ?int $record_id=null)
getRecordFieldValue(?string $field_id)
Get Field Value.
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
passThroughFilter(ilDclBaseRecordModel $record, $filter)
addFilterItemByMetaType(string $id, int $type=self::FILTER_TEXT, bool $a_optional=false, string $caption="")
Add filter by standard type.
setupFilterInputField(?ilTableFilterItem $input)
Set basic settings for filter-input-gui.