ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 require_once('./Modules/DataCollection/classes/Fields/Base/class.ilDclBaseRecordFieldModel.php');
6 require_once('class.ilDclStack.php');
7 require_once('class.ilDclExpressionParser.php');
8 require_once('class.ilDclTokenizer.php');
9 
19 
23  protected $expression = '';
24 
28  protected $parsed_value = '';
29 
30 
36  parent::__construct($record, $field);
37 
38  $this->expression = $this->getField()->getProperty(ilDclBaseFieldModel::PROP_FORMULA_EXPRESSION);
39  }
40 
41 
45  public function addHiddenItemsToConfirmation(ilConfirmationGUI &$confirmation) {
46  return;
47  }
48 
49 
53  protected function loadValue() {
54  return NULL;
55  }
56 
57 
64  public function setValue($value, $omit_parsing = false) {
65  unset($value);
66  }
67 
68 
72  public function doUpdate() {
73  return NULL;
74  }
75 
76 
80  public function doRead() {
81  return NULL;
82  }
83 
84 
88  public function delete() {
89  return NULL;
90  }
91 
92 
97  public function getFormInput() {
98  return $this->parse();
99  }
100 
101 
105  public function getHTML() {
106  return $this->parse();
107  }
108 
109 
113  public function getExportValue() {
114  return $this->parse();
115  }
116 
117 
121  public function getValue() {
122  return $this->parse();
123  }
124 
125 
131  protected function parse() {
132  if (!$this->parsed_value && $this->expression) {
133  $parser = new ilDclExpressionParser($this->expression, $this->getRecord(), $this->getField());
134  try {
135  $this->parsed_value = $parser->parse();
136  } catch (ilException $e) {
137  return $this->lng->txt('dcl_error_parsing_expression') . ' (' . $e->getMessage() . ')';
138  }
139  }
140 
141  return $this->parsed_value;
142  }
143 }
Class ilDclBaseFieldModel.
Class ilDclExpressionParser.
Base class for ILIAS Exception handling.
doRead()
Do nothing, value is runtime only and not stored in DB.
addHiddenItemsToConfirmation(ilConfirmationGUI &$confirmation)
setValue($value, $omit_parsing=false)
Set value for record field.
__construct(ilDclBaseRecordModel $record, ilDclBaseFieldModel $field)
$parser
Definition: BPMN2Parser.php:24
Class ilDclBaseRecordModel.
doUpdate()
Do nothing, value is runtime only and not stored in DB.
loadValue()
Do nothing, value is runtime only and not stored in DB.
Confirmation screen class.