ILIAS  release_8 Revision v8.24
class.ilDclNumberFieldRepresentation.php
Go to the documentation of this file.
1<?php
2
20{
21 public function getInputField(ilPropertyFormGUI $form, ?int $record_id = null): ilNumberInputGUI
22 {
23 $input = new ilNumberInputGUI($this->getField()->getTitle(), 'field_' . $this->getField()->getId());
24 // 9 is the maximum number of digits for an integer
25 $input->setMaxLength(9);
26 $input->setInfo($this->lng->txt('dcl_max_digits') . ": 9");
27 $this->setupInputField($input, $this->getField());
28
29 return $input;
30 }
31
38 {
39 $input = $table->addFilterItemByMetaType(
40 "filter_" . $this->getField()->getId(),
42 false,
43 $this->getField()->getId()
44 );
45 $input->setSubmitFormOnEnter(true);
46
47 $this->setupFilterInputField($input);
48
49 return $this->getFilterInputFieldValue($input);
50 }
51
55 public function passThroughFilter(ilDclBaseRecordModel $record, $filter): bool
56 {
57 $value = $record->getRecordFieldValue($this->getField()->getId());
58 if ((!$filter['from'] || $value >= $filter['from']) && (!$filter['to'] || $value <= $filter['to'])) {
59 return true;
60 }
61
62 return false;
63 }
64
65 protected function buildFieldCreationInput(ilObjDataCollection $dcl, string $mode = 'create'): ilRadioOption
66 {
67 $opt = parent::buildFieldCreationInput($dcl, $mode);
68
69 return $opt;
70 }
71}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setupInputField(ilFormPropertyGUI $input, ilDclBaseFieldModel $field)
Sets basic settings on field-input.
setupFilterInputField(?ilTableFilterItem $input)
Set basic settings for filter-input-gui.
getRecordFieldValue(?int $field_id)
Get Field Value.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getInputField(ilPropertyFormGUI $form, ?int $record_id=null)
Returns field-input.
buildFieldCreationInput(ilObjDataCollection $dcl, string $mode='create')
Build the creation-input-field.
passThroughFilter(ilDclBaseRecordModel $record, $filter)
This class represents a number property in a property form.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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...
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_NUMBER_RANGE