ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f87
ilDataCollectionFormulaField Class Reference

Class ilDataCollectionField. More...

+ Inheritance diagram for ilDataCollectionFormulaField:
+ Collaboration diagram for ilDataCollectionFormulaField:

Public Member Functions

 __construct (ilDataCollectionRecord $record, ilDataCollectionField $field)
 
 setValue ($value)
 
 doUpdate ()
 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...
 
 delete ()
 Do nothing, value is runtime only and not stored in DB. More...
 
 getFormInput ()
 
 getHTML ()
 
 getExportValue ()
 
 getValue ()
 
- Public Member Functions inherited from ilDataCollectionRecordField
 __construct (ilDataCollectionRecord $record, ilDataCollectionField $field)
 
 doUpdate ()
 Update object in database. More...
 
 delete ()
 Delete record field in database. More...
 
 getValue ()
 
 setValue ($value, $omit_parsing=false)
 Set value for record field. More...
 
 getFormInput ()
 
 getExportValue ()
 
 getPlainText ()
 
 getHTML ($link=true)
 
 getSortingValue ($link=true)
 
 getSingleHTML ()
 
 getField ()
 
 getId ()
 
 getRecord ()
 

Protected Member Functions

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

Protected Attributes

 $expression = ''
 
 $field_properties = array()
 
 $parsed_value = ''
 
- Protected Attributes inherited from ilDataCollectionRecordField
 $id
 
 $field
 
 $record
 
 $value
 
 $lng
 
 $user
 
 $ctrl
 
 $db
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilDataCollectionFormulaField::__construct ( ilDataCollectionRecord  $record,
ilDataCollectionField  $field 
)
Parameters
ilDataCollectionRecord$record
ilDataCollectionField$field

Definition at line 38 of file class.ilDataCollectionFormulaField.php.

References ilDataCollectionField\getProperties(), and ilDataCollectionField\PROPERTYID_FORMULA_EXPRESSION.

38  {
39  parent::__construct($record, $field);
40  $this->field_properties = $field->getProperties();
41  $this->expression = $this->field_properties[ilDataCollectionField::PROPERTYID_FORMULA_EXPRESSION];
42  }
getProperties()
Get all properties of a field.
+ Here is the call graph for this function:

Member Function Documentation

◆ delete()

ilDataCollectionFormulaField::delete ( )

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

Definition at line 80 of file class.ilDataCollectionFormulaField.php.

80  {
81  return NULL;
82  }

◆ doRead()

ilDataCollectionFormulaField::doRead ( )

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

Definition at line 72 of file class.ilDataCollectionFormulaField.php.

72  {
73  return NULL;
74  }

◆ doUpdate()

ilDataCollectionFormulaField::doUpdate ( )

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

Definition at line 64 of file class.ilDataCollectionFormulaField.php.

64  {
65  return NULL;
66  }

◆ getExportValue()

ilDataCollectionFormulaField::getExportValue ( )
Returns
string

Definition at line 105 of file class.ilDataCollectionFormulaField.php.

References parse().

105  {
106  return $this->parse();
107  }
+ Here is the call graph for this function:

◆ getFormInput()

ilDataCollectionFormulaField::getFormInput ( )
Returns
mixed|string

Definition at line 89 of file class.ilDataCollectionFormulaField.php.

References parse().

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

◆ getHTML()

ilDataCollectionFormulaField::getHTML ( )
Returns
string

Definition at line 97 of file class.ilDataCollectionFormulaField.php.

References parse().

97  {
98  return $this->parse();
99  }
+ Here is the call graph for this function:

◆ getValue()

ilDataCollectionFormulaField::getValue ( )
Returns
string

Definition at line 113 of file class.ilDataCollectionFormulaField.php.

References parse().

113  {
114  return $this->parse();
115  }
+ Here is the call graph for this function:

◆ loadValue()

ilDataCollectionFormulaField::loadValue ( )
protected

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

Definition at line 48 of file class.ilDataCollectionFormulaField.php.

48  {
49  return NULL;
50  }

◆ parse()

ilDataCollectionFormulaField::parse ( )
protected

Parse expression.

Returns
string

Definition at line 123 of file class.ilDataCollectionFormulaField.php.

References $parsed_value.

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

123  {
124  if (!$this->parsed_value AND $this->expression) {
125  $parser = new ilDclExpressionParser($this->expression, $this->record, $this->field);
126  try {
127  $this->parsed_value = $parser->parse();
128  } catch (ilException $e) {
129  return $this->lng->txt('dcl_error_parsing_expression') . ' (' . $e->getMessage() . ')';
130  }
131  }
132 
133  return $this->parsed_value;
134  }
Class ilDclExpressionParser.
Base class for ILIAS Exception handling.
+ Here is the caller graph for this function:

◆ setValue()

ilDataCollectionFormulaField::setValue (   $value)
Parameters
$value

Definition at line 56 of file class.ilDataCollectionFormulaField.php.

References ilDataCollectionRecordField\$value.

Field Documentation

◆ $expression

ilDataCollectionFormulaField::$expression = ''
protected

Definition at line 23 of file class.ilDataCollectionFormulaField.php.

◆ $field_properties

ilDataCollectionFormulaField::$field_properties = array()
protected

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

◆ $parsed_value

ilDataCollectionFormulaField::$parsed_value = ''
protected

Definition at line 31 of file class.ilDataCollectionFormulaField.php.

Referenced by parse().


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