ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilDclNumberFieldRepresentation.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): ilNumberInputGUI
24 {
25 $input = new ilNumberInputGUI($this->getField()->getTitle(), 'field_' . $this->getField()->getId());
26 // 9 is the maximum number of digits for an integer
27 $input->setMaxLength(9);
28 $input->setInfo($this->lng->txt('dcl_max_digits') . ": 9");
29 $this->setupInputField($input, $this->getField());
30
31 return $input;
32 }
33
40 {
41 $input = $table->addFilterItemByMetaType(
42 "filter_" . $this->getField()->getId(),
44 false,
45 $this->getField()->getId()
46 );
47 $input->setSubmitFormOnEnter(true);
48
49 $this->setupFilterInputField($input);
50
51 return $this->getFilterInputFieldValue($input);
52 }
53
57 public function passThroughFilter(ilDclBaseRecordModel $record, $filter): bool
58 {
59 $value = $record->getRecordFieldValue($this->getField()->getId());
60 if ((!$filter['from'] || $value >= $filter['from']) && (!$filter['to'] || $value <= $filter['to'])) {
61 return true;
62 }
63
64 return false;
65 }
66
67 protected function buildFieldCreationInput(ilObjDataCollection $dcl, string $mode = 'create'): ilRadioOption
68 {
69 return parent::buildFieldCreationInput($dcl, $mode);
70 }
71}
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.
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 class represents a property form user interface.
This class represents an option in a radio group.
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