ILIAS  trunk Revision v11.0_alpha-1866-gfa368f7776e
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilDclFormulaRecordFieldModel Class Reference
+ Inheritance diagram for ilDclFormulaRecordFieldModel:
+ Collaboration diagram for ilDclFormulaRecordFieldModel:

Public Member Functions

 __construct (ilDclBaseRecordModel $record, ilDclBaseFieldModel $field)
 
 addHiddenItemsToConfirmation (ilConfirmationGUI $confirmation)
 
 setValue ($value, bool $omit_parsing=false)
 Set value for record field. More...
 
 doUpdate ()
 Do nothing, value is runtime only and not stored in DB. More...
 
 delete ()
 Do nothing, value is runtime only and not stored in DB. More...
 
 getFormInput ()
 
 getHTML ()
 
 getExportValue ()
 
 getValue ()
 
- Public Member Functions inherited from ilDclBaseRecordFieldModel
 __construct (ilDclBaseRecordModel $record, ilDclBaseFieldModel $field)
 
 doCreate ()
 Creates an Id and a database entry. More...
 
 doUpdate ()
 Update object in database. More...
 
 delete ()
 Delete record field in database. More...
 
 getValue ()
 
 getValueForRepresentation ()
 
 serializeData ($value)
 Serialize data before storing to db. More...
 
 deserializeData ($value)
 Deserialize data before applying to field. More...
 
 setValue ($value, bool $omit_parsing=false)
 Set value for record field. More...
 
 setValueFromForm (ilPropertyFormGUI $form)
 
 getFormulaValue ()
 
 parseExportValue ($value)
 Function to parse incoming data from form input value $value. More...
 
 getValueFromExcel (ilExcel $excel, int $row, int $col)
 
 parseValue ($value)
 Function to parse incoming data from form input value $value. More...
 
 getExportValue ()
 
 fillExcelExport (ilExcel $worksheet, int &$row, int &$col)
 
 getPlainText ()
 
 getSortingValue (bool $link=true)
 
 addHiddenItemsToConfirmation (ilConfirmationGUI $confirmation)
 
 parseSortingValue ($value, bool $link=true)
 Returns sortable value for the specific field-types. More...
 
 cloneStructure (ilDclBaseRecordFieldModel $old_record_field)
 
 afterClone ()
 
 getField ()
 
 getId ()
 
 getRecord ()
 
 getRecordRepresentation ()
 
 setRecordRepresentation (ilDclBaseRecordRepresentation $record_representation)
 
 getFieldRepresentation ()
 
 setFieldRepresentation (ilDclBaseFieldRepresentation $field_representation)
 

Protected Member Functions

 loadValue ()
 Do nothing, value is runtime only and not stored in DB. More...
 
 doRead ()
 Do nothing, value is runtime only and not stored in DB. More...
 
 parse ()
 Parse expression. More...
 
- Protected Member Functions inherited from ilDclBaseRecordFieldModel
 doRead ()
 Read object data from database. More...
 
 loadValue ()
 Load the value. More...
 

Protected Attributes

string $expression = ''
 
string $parsed_value = ''
 
- Protected Attributes inherited from ilDclBaseRecordFieldModel
int $id = null
 
ilDclBaseFieldModel $field
 
ilDclBaseRecordModel $record
 
ilDclBaseRecordRepresentation $record_representation = null
 
ilDclBaseFieldRepresentation $field_representation = null
 
 $value
 
ilObjUser $user
 
ilCtrl $ctrl
 
ilDBInterface $db
 
ilLanguage $lng
 
ILIAS HTTP Services $http
 
ILIAS Refinery Factory $refinery
 

Detailed Description

Definition at line 24 of file class.ilDclFormulaRecordFieldModel.php.

Constructor & Destructor Documentation

◆ __construct()

ilDclFormulaRecordFieldModel::__construct ( ilDclBaseRecordModel  $record,
ilDclBaseFieldModel  $field 
)

Definition at line 29 of file class.ilDclFormulaRecordFieldModel.php.

References ILIAS\GlobalScreen\Provider\__construct(), ilDclBaseRecordFieldModel\getField(), and ilDclBaseFieldModel\PROP_FORMULA_EXPRESSION.

30  {
31  parent::__construct($record, $field);
32 
33  $this->expression = (string) $this->getField()->getProperty(ilDclBaseFieldModel::PROP_FORMULA_EXPRESSION);
34  }
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ addHiddenItemsToConfirmation()

ilDclFormulaRecordFieldModel::addHiddenItemsToConfirmation ( ilConfirmationGUI  $confirmation)

Definition at line 36 of file class.ilDclFormulaRecordFieldModel.php.

36  : void
37  {
38  }

◆ delete()

ilDclFormulaRecordFieldModel::delete ( )

Do nothing, value is runtime only and not stored in DB.

Definition at line 74 of file class.ilDclFormulaRecordFieldModel.php.

74  : void
75  {
76  }

◆ doRead()

ilDclFormulaRecordFieldModel::doRead ( )
protected

Do nothing, value is runtime only and not stored in DB.

Definition at line 67 of file class.ilDclFormulaRecordFieldModel.php.

67  : void
68  {
69  }

◆ doUpdate()

ilDclFormulaRecordFieldModel::doUpdate ( )

Do nothing, value is runtime only and not stored in DB.

Definition at line 60 of file class.ilDclFormulaRecordFieldModel.php.

60  : void
61  {
62  }

◆ getExportValue()

ilDclFormulaRecordFieldModel::getExportValue ( )

Definition at line 88 of file class.ilDclFormulaRecordFieldModel.php.

References parse().

88  : string
89  {
90  return $this->parse();
91  }
+ Here is the call graph for this function:

◆ getFormInput()

ilDclFormulaRecordFieldModel::getFormInput ( )

Definition at line 78 of file class.ilDclFormulaRecordFieldModel.php.

References parse().

78  : string
79  {
80  return $this->parse();
81  }
+ Here is the call graph for this function:

◆ getHTML()

ilDclFormulaRecordFieldModel::getHTML ( )

Definition at line 83 of file class.ilDclFormulaRecordFieldModel.php.

References parse().

83  : string
84  {
85  return $this->parse();
86  }
+ Here is the call graph for this function:

◆ getValue()

ilDclFormulaRecordFieldModel::getValue ( )

Definition at line 93 of file class.ilDclFormulaRecordFieldModel.php.

References parse().

93  : string
94  {
95  return $this->parse();
96  }
+ Here is the call graph for this function:

◆ loadValue()

ilDclFormulaRecordFieldModel::loadValue ( )
protected

Do nothing, value is runtime only and not stored in DB.

Definition at line 43 of file class.ilDclFormulaRecordFieldModel.php.

43  : void
44  {
45  }

◆ parse()

ilDclFormulaRecordFieldModel::parse ( )
protected

Parse expression.

Definition at line 101 of file class.ilDclFormulaRecordFieldModel.php.

References Vendor\Package\$e, $parsed_value, ilDclBaseRecordFieldModel\getField(), ilDclBaseRecordFieldModel\getRecord(), and ILIAS\Repository\lng().

Referenced by getExportValue(), getFormInput(), getHTML(), and getValue().

101  : string
102  {
103  if (!$this->parsed_value && $this->expression) {
104  $substitution = new FieldSubstitution(
105  $this->getRecord(),
106  $this->getField()
107  );
108 
109  $parser = new ExpressionParser(
110  $this->expression,
111  $substitution
112  );
113 
114 
115  //$parser = new ilDclExpressionParser($this->expression, $this->getRecord(), $this->getField());
116  try {
117  $this->parsed_value = $parser->parse();
118  } catch (ilException $e) {
119  return $this->lng->txt('dcl_error_parsing_expression') . ' (' . $e->getMessage() . ')';
120  }
121  }
122 
123  return $this->parsed_value;
124  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setValue()

ilDclFormulaRecordFieldModel::setValue (   $value,
bool  $omit_parsing = false 
)

Set value for record field.

Parameters
int | float$value
bool$omit_parsingIf true, does not parse the value and stores it in the given format

Definition at line 52 of file class.ilDclFormulaRecordFieldModel.php.

References ilDclBaseRecordFieldModel\$value.

52  : void
53  {
54  unset($value);
55  }

Field Documentation

◆ $expression

string ilDclFormulaRecordFieldModel::$expression = ''
protected

Definition at line 26 of file class.ilDclFormulaRecordFieldModel.php.

◆ $parsed_value

string ilDclFormulaRecordFieldModel::$parsed_value = ''
protected

Definition at line 27 of file class.ilDclFormulaRecordFieldModel.php.

Referenced by parse().


The documentation for this class was generated from the following file: