ILIAS  release_8 Revision v8.24
class.ilDclFormulaRecordFieldModel.php
Go to the documentation of this file.
1<?php
2
20{
21 protected string $expression = '';
22 protected string $parsed_value = '';
23
25 {
27
28 $this->expression = (string) $this->getField()->getProperty(ilDclBaseFieldModel::PROP_FORMULA_EXPRESSION);
29 }
30
31 public function addHiddenItemsToConfirmation(ilConfirmationGUI $confirmation): void
32 {
33 }
34
38 protected function loadValue(): void
39 {
40 }
41
47 public function setValue($value, bool $omit_parsing = false): void
48 {
49 unset($value);
50 }
51
55 public function doUpdate(): void
56 {
57 }
58
62 protected function doRead(): void
63 {
64 }
65
69 public function delete(): void
70 {
71 }
72
73 public function getFormInput(): string
74 {
75 return $this->parse();
76 }
77
78 public function getHTML(): string
79 {
80 return $this->parse();
81 }
82
83 public function getExportValue(): string
84 {
85 return $this->parse();
86 }
87
88 public function getValue(): string
89 {
90 return $this->parse();
91 }
92
96 protected function parse(): string
97 {
98 if (!$this->parsed_value && $this->expression) {
99 $parser = new ilDclExpressionParser($this->expression, $this->getRecord(), $this->getField());
100 try {
101 $this->parsed_value = $parser->parse();
102 } catch (ilException $e) {
103 return $this->lng->txt('dcl_error_parsing_expression') . ' (' . $e->getMessage() . ')';
104 }
105 }
106
107 return $this->parsed_value;
108 }
109}
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...
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...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
addHiddenItemsToConfirmation(ilConfirmationGUI $confirmation)
doRead()
Do nothing, value is runtime only and not stored in DB.
setValue($value, bool $omit_parsing=false)
Set value for record field.
__construct(ilDclBaseRecordModel $record, ilDclBaseFieldModel $field)
loadValue()
Do nothing, value is runtime only and not stored in DB.
doUpdate()
Do nothing, value is runtime only and not stored in DB.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc