ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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
5
15{
16
20 protected $expression = '';
21
25 protected $parsed_value = '';
26
27
33 {
34 parent::__construct($record, $field);
35
36 $this->expression = $this->getField()->getProperty(ilDclBaseFieldModel::PROP_FORMULA_EXPRESSION);
37 }
38
39
43 public function addHiddenItemsToConfirmation(ilConfirmationGUI &$confirmation)
44 {
45 return;
46 }
47
48
52 protected function loadValue()
53 {
54 return null;
55 }
56
57
64 public function setValue($value, $omit_parsing = false)
65 {
66 unset($value);
67 }
68
69
73 public function doUpdate()
74 {
75 return null;
76 }
77
78
82 public function doRead()
83 {
84 return null;
85 }
86
87
91 public function delete()
92 {
93 return null;
94 }
95
96
101 public function getFormInput()
102 {
103 return $this->parse();
104 }
105
106
110 public function getHTML()
111 {
112 return $this->parse();
113 }
114
115
119 public function getExportValue()
120 {
121 return $this->parse();
122 }
123
124
128 public function getValue()
129 {
130 return $this->parse();
131 }
132
133
139 protected function parse()
140 {
141 if (!$this->parsed_value && $this->expression) {
142 $parser = new ilDclExpressionParser($this->expression, $this->getRecord(), $this->getField());
143 try {
144 $this->parsed_value = $parser->parse();
145 } catch (ilException $e) {
146 return $this->lng->txt('dcl_error_parsing_expression') . ' (' . $e->getMessage() . ')';
147 }
148 }
149
150 return $this->parsed_value;
151 }
152}
$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.