ILIAS  release_8 Revision v8.23
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 
37  public function addFilterInputFieldToTable(ilTable2GUI $table)
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...
buildFieldCreationInput(ilObjDataCollection $dcl, string $mode='create')
const FILTER_NUMBER_RANGE
setupInputField(ilFormPropertyGUI $input, ilDclBaseFieldModel $field)
Sets basic settings on field-input.
getRecordFieldValue(?int $field_id)
Get Field Value.
addFilterItemByMetaType(string $id, int $type=self::FILTER_TEXT, bool $a_optional=false, string $caption="")
Add filter by standard type.
This class represents a number property in a property form.
getInputField(ilPropertyFormGUI $form, ?int $record_id=null)
setupFilterInputField(?ilTableFilterItem $input)
Set basic settings for filter-input-gui.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
passThroughFilter(ilDclBaseRecordModel $record, $filter)
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...