ILIAS  trunk Revision v11.0_alpha-2662-g519ff7d528f
ilDclBooleanFieldRepresentation Class Reference
+ Inheritance diagram for ilDclBooleanFieldRepresentation:
+ Collaboration diagram for ilDclBooleanFieldRepresentation:

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...
 

Additional Inherited Members

- 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...
 
- Protected Attributes inherited from ilDclBaseFieldRepresentation
ilDclBaseFieldModel $field
 
ilLanguage $lng
 
ilCtrl $ctrl
 
ilObjUser $user
 
ILIAS HTTP Services $http
 
ILIAS Refinery Factory $refinery
 
ilComponentRepository $component_repository
 
ilComponentFactory $component_factory
 

Detailed Description

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

Member Function Documentation

◆ addFilterInputFieldToTable()

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

Definition at line 36 of file class.ilDclBooleanFieldRepresentation.php.

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

37  {
38  $input = $table->addFilterItemByMetaType(
39  "filter_" . $this->getField()->getId(),
41  false,
42  $this->getField()->getId()
43  );
44  $input->setOptions(
45  [
46  "" => $this->lng->txt("dcl_any"),
47  "not_checked" => $this->lng->txt("dcl_not_checked"),
48  "checked" => $this->lng->txt("dcl_checked"),
49  ]
50  );
51 
52  $this->setupFilterInputField($input);
53 
54  return $this->getFilterInputFieldValue($input);
55  }
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:

◆ getInputField()

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

Definition at line 23 of file class.ilDclBooleanFieldRepresentation.php.

References ilDclBaseFieldRepresentation\getField(), ILIAS\Survey\Mode\getId(), ILIAS\GlobalScreen\Scope\Footer\Factory\getTitle(), and ilDclBaseFieldRepresentation\setupInputField().

24  {
25  $input = new ilDclCheckboxInputGUI($this->getField()->getTitle(), 'field_' . $this->getField()->getId());
26  $this->setupInputField($input, $this->getField());
27 
28  return $input;
29  }
setupInputField(ilFormPropertyGUI $input, ilDclBaseFieldModel $field)
Sets basic settings on field-input.
+ Here is the call graph for this function:

◆ passThroughFilter()

ilDclBooleanFieldRepresentation::passThroughFilter ( ilDclBaseRecordModel  $record,
  $filter 
)

Definition at line 57 of file class.ilDclBooleanFieldRepresentation.php.

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

57  : bool
58  {
59  $value = $record->getRecordFieldValue($this->getField()->getId());
60  if ((($filter == "checked" && $value == 1) || ($filter == "not_checked" && $value == 0)) || $filter == '' || !$filter) {
61  return true;
62  }
63 
64  return false;
65  }
getRecordFieldValue(?string $field_id)
Get Field Value.
+ Here is the call graph for this function:

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