ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilDclFormulaRecordFieldModel.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
4
14{
15
19 protected $expression = '';
23 protected $parsed_value = '';
24
25
31 {
32 parent::__construct($record, $field);
33
34 $this->expression = $this->getField()->getProperty(ilDclBaseFieldModel::PROP_FORMULA_EXPRESSION);
35 }
36
37
41 public function addHiddenItemsToConfirmation(ilConfirmationGUI &$confirmation)
42 {
43 return;
44 }
45
46
50 protected function loadValue()
51 {
52 return null;
53 }
54
55
62 public function setValue($value, $omit_parsing = false)
63 {
64 unset($value);
65 }
66
67
71 public function doUpdate()
72 {
73 return null;
74 }
75
76
80 public function doRead()
81 {
82 return null;
83 }
84
85
89 public function delete()
90 {
91 return null;
92 }
93
94
99 public function getFormInput()
100 {
101 return $this->parse();
102 }
103
104
108 public function getHTML()
109 {
110 return $this->parse();
111 }
112
113
117 public function getExportValue()
118 {
119 return $this->parse();
120 }
121
122
126 public function getValue()
127 {
128 return $this->parse();
129 }
130
131
137 protected function parse()
138 {
139 if (!$this->parsed_value && $this->expression) {
140 $parser = new ilDclExpressionParser($this->expression, $this->getRecord(), $this->getField());
141 try {
142 $this->parsed_value = $parser->parse();
143 } catch (ilException $e) {
144 return $this->lng->txt('dcl_error_parsing_expression') . ' (' . $e->getMessage() . ')';
145 }
146 }
147
148 return $this->parsed_value;
149 }
150}
$parser
Definition: BPMN2Parser.php:23
An exception for terminatinating execution or to throw for unit testing.
Confirmation screen class.
Class ilDclBaseFieldModel.
Class ilDclBaseRecordModel.
Class ilDclExpressionParser.
doRead()
Do nothing, value is runtime only and not stored in DB.
setValue($value, $omit_parsing=false)
Set value for record field.
addHiddenItemsToConfirmation(ilConfirmationGUI &$confirmation)
__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.
Base class for ILIAS Exception handling.