ILIAS  release_8 Revision v8.24
class.ilDclBooleanFieldRepresentation.php
Go to the documentation of this file.
1<?php
2
20{
21 public function getInputField(ilPropertyFormGUI $form, ?int $record_id = null): ilDclCheckboxInputGUI
22 {
23 $input = new ilDclCheckboxInputGUI($this->getField()->getTitle(), 'field_' . $this->getField()->getId());
24 $this->setupInputField($input, $this->getField());
25
26 return $input;
27 }
28
35 {
36 $input = $table->addFilterItemByMetaType(
37 "filter_" . $this->getField()->getId(),
39 false,
40 $this->getField()->getId()
41 );
42 $input->setOptions(
43 array(
44 "" => $this->lng->txt("dcl_any"),
45 "not_checked" => $this->lng->txt("dcl_not_checked"),
46 "checked" => $this->lng->txt("dcl_checked"),
47 )
48 );
49
50 $this->setupFilterInputField($input);
51
52 return $this->getFilterInputFieldValue($input);
53 }
54
55 public function passThroughFilter(ilDclBaseRecordModel $record, $filter): bool
56 {
57 $value = $record->getRecordFieldValue($this->getField()->getId());
58 if ((($filter == "checked" && $value == 1) || ($filter == "not_checked" && $value == 0)) || $filter == '' || !$filter) {
59 return true;
60 }
61
62 return false;
63 }
64}
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.
passThroughFilter(ilDclBaseRecordModel $record, $filter)
Checks if a filter affects a record.
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...
addFilterItemByMetaType(string $id, int $type=self::FILTER_TEXT, bool $a_optional=false, string $caption="")
Add filter by standard type.