ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilDclNumberFieldRepresentation Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilDclNumberFieldRepresentation:
+ Collaboration diagram for ilDclNumberFieldRepresentation:

Public Member Functions

 getInputField (ilPropertyFormGUI $form, ?int $record_id=null)
 
 addFilterInputFieldToTable (ilTable2GUI $table)
 
 passThroughFilter (ilDclBaseRecordModel $record, $filter)
 
- Public Member Functions inherited from ilDclBaseFieldRepresentation
 __construct (ilDclBaseFieldModel $field)
 
 addFilterInputFieldToTable (ilTable2GUI $table)
 Add filter input to TableGUI. More...
 
 passThroughFilter (ilDclBaseRecordModel $record, $filter)
 Checks if a filter affects a record. More...
 
 parseSortingValue (string $value, bool $link=true)
 
 getInputField (ilPropertyFormGUI $form, ?int $record_id=null)
 Returns field-input. More...
 
 addFieldCreationForm (ilSubEnabledFormPropertyGUI $form, ilObjDataCollection $dcl, string $mode="create")
 Adds the options for the field-types to the field-creation form. More...
 
 getPropertyInputFieldId (string $property)
 Return post-var for property-fields. More...
 
 getField ()
 Return BaseFieldModel. More...
 

Protected Member Functions

 buildFieldCreationInput (ilObjDataCollection $dcl, string $mode='create')
 
- Protected Member Functions inherited from ilDclBaseFieldRepresentation
 setupFilterInputField (?ilTableFilterItem $input)
 Set basic settings for filter-input-gui. More...
 
 setupInputField (ilFormPropertyGUI $input, ilDclBaseFieldModel $field)
 Sets basic settings on field-input. More...
 
 getFilterInputFieldValue (ilTableFilterItem $input)
 
 buildFieldCreationInput (ilObjDataCollection $dcl, string $mode='create')
 Build the creation-input-field. More...
 

Additional Inherited Members

- Protected Attributes inherited from ilDclBaseFieldRepresentation
ilDclBaseFieldModel $field
 
ilLanguage $lng
 
ilCtrl $ctrl
 
ILIAS HTTP Services $http
 
ILIAS Refinery Factory $refinery
 
ilComponentRepository $component_repository
 
ilComponentFactory $component_factory
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning

Definition at line 19 of file class.ilDclNumberFieldRepresentation.php.

Member Function Documentation

◆ addFilterInputFieldToTable()

ilDclNumberFieldRepresentation::addFilterInputFieldToTable ( ilTable2GUI  $table)
Parameters
ilTable2GUI$table
Returns
array|string|null
Exceptions
Exception

Definition at line 37 of file class.ilDclNumberFieldRepresentation.php.

References ilTable2GUI\addFilterItemByMetaType(), ilTable2GUI\FILTER_NUMBER_RANGE, ilDclBaseFieldRepresentation\getField(), ilDclBaseFieldRepresentation\getFilterInputFieldValue(), ILIAS\Survey\Mode\getId(), and ilDclBaseFieldRepresentation\setupFilterInputField().

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  }
const FILTER_NUMBER_RANGE
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.
+ Here is the call graph for this function:

◆ buildFieldCreationInput()

ilDclNumberFieldRepresentation::buildFieldCreationInput ( ilObjDataCollection  $dcl,
string  $mode = 'create' 
)
protected

Definition at line 65 of file class.ilDclNumberFieldRepresentation.php.

66  {
67  $opt = parent::buildFieldCreationInput($dcl, $mode);
68 
69  return $opt;
70  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ getInputField()

ilDclNumberFieldRepresentation::getInputField ( ilPropertyFormGUI  $form,
?int  $record_id = null 
)

Definition at line 21 of file class.ilDclNumberFieldRepresentation.php.

References ilDclBaseFieldRepresentation\getField(), ILIAS\Survey\Mode\getId(), ILIAS\Repository\lng(), and ilDclBaseFieldRepresentation\setupInputField().

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  }
setupInputField(ilFormPropertyGUI $input, ilDclBaseFieldModel $field)
Sets basic settings on field-input.
This class represents a number property in a property form.
+ Here is the call graph for this function:

◆ passThroughFilter()

ilDclNumberFieldRepresentation::passThroughFilter ( ilDclBaseRecordModel  $record,
  $filter 
)
Parameters
array$filter

Definition at line 55 of file class.ilDclNumberFieldRepresentation.php.

References ilDclBaseFieldRepresentation\getField(), ILIAS\Survey\Mode\getId(), and ilDclBaseRecordModel\getRecordFieldValue().

55  : 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  }
getRecordFieldValue(?int $field_id)
Get Field Value.
+ Here is the call graph for this function:

The documentation for this class was generated from the following file: