ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilDclRatingRecordFieldModel Class Reference

Class ilDclBaseFieldModel. More...

+ Inheritance diagram for ilDclRatingRecordFieldModel:
+ Collaboration diagram for ilDclRatingRecordFieldModel:

Public Member Functions

 __construct (ilDclBaseRecordModel $record, ilDclBaseFieldModel $field)
 
 addHiddenItemsToConfirmation (ilConfirmationGUI &$confirmation)
 
 setValue ($value, $omit_parsing=false)
 Set value for record field. More...
 
 doUpdate ()
 
 doRead ()
 
 getExportValue ()
 return Export values More...
 
 getValue ()
 
 delete ()
 delete More...
 
- 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, $omit_parsing=false)
 Set value for record field. More...
 
 setValueFromForm ($form)
 
 getFormulaValue ()
 
 parseExportValue ($value)
 Function to parse incoming data from form input value $value. More...
 
 getValueFromExcel ($excel, $row, $col)
 
 parseValue ($value)
 Function to parse incoming data from form input value $value. More...
 
 getExportValue ()
 
 fillExcelExport (ilExcel $worksheet, &$row, &$col)
 
 getPlainText ()
 
 getSortingValue ($link=true)
 
 addHiddenItemsToConfirmation (ilConfirmationGUI &$confirmation)
 
 parseSortingValue ($value, $link=true)
 Returns sortable value for the specific field-types. More...
 
 cloneStructure (ilDclBaseRecordFieldModel $old_record_field)
 
 afterClone ()
 
 getField ()
 
 getId ()
 
 getRecord ()
 
 getRecordRepresentation ()
 
 setRecordRepresentation ($record_representation)
 
 getFieldRepresentation ()
 
 setFieldRepresentation ($field_representation)
 

Protected Member Functions

 loadValue ()
 override the loadValue. More...
 
- Protected Member Functions inherited from ilDclBaseRecordFieldModel
 doRead ()
 Read object data from database. More...
 
 loadValue ()
 Load the value. More...
 

Protected Attributes

 $rated
 
 $dcl_obj_id
 
- Protected Attributes inherited from ilDclBaseRecordFieldModel
 $id
 
 $field
 
 $record
 
 $record_representation
 
 $field_representation
 
 $value
 
 $user
 
 $ctrl
 
 $db
 
 $lng
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

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

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

References ilDclBaseRecordFieldModel\getField(), and ilDclCache\getTableCache().

30  {
31  parent::__construct($record, $field);
32 
33  $dclTable = ilDclCache::getTableCache($this->getField()->getTableId());
34  $this->dcl_obj_id = $dclTable->getCollectionObject()->getId();
35  }
static getTableCache($table_id=0)
+ Here is the call graph for this function:

Member Function Documentation

◆ addHiddenItemsToConfirmation()

ilDclRatingRecordFieldModel::addHiddenItemsToConfirmation ( ilConfirmationGUI $confirmation)

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

39  {
40  return;
41  }

◆ delete()

ilDclRatingRecordFieldModel::delete ( )

delete

Definition at line 102 of file class.ilDclRatingRecordFieldModel.php.

References $DIC, $ilDB, ilDclBaseRecordFieldModel\getField(), and ilDclBaseRecordFieldModel\getId().

103  {
104  global $DIC;
105  $ilDB = $DIC['ilDB'];
106 
107  $ilDB->manipulate(
108  "DELETE FROM il_rating WHERE " .
109  "obj_id = " . $ilDB->quote((int) $this->getRecord()->getId(), "integer") . " AND " .
110  "obj_type = " . $ilDB->quote("dcl_record", "text") . " AND " .
111  "sub_obj_id = " . $ilDB->quote((int) $this->getField()->getId(), "integer") . " AND " .
112  $ilDB->equals("sub_obj_type", "dcl_field", "text", true)
113  );
114 
115  $query2 = "DELETE FROM il_dcl_record_field WHERE id = " . $ilDB->quote($this->getId(), "integer");
116  $ilDB->manipulate($query2);
117  }
global $DIC
Definition: saml.php:7
global $ilDB
+ Here is the call graph for this function:

◆ doRead()

ilDclRatingRecordFieldModel::doRead ( )

Definition at line 71 of file class.ilDclRatingRecordFieldModel.php.

72  {
73  // explicitly do nothing. the value is handled via the model and gui of ilRating.
74  }

◆ doUpdate()

ilDclRatingRecordFieldModel::doUpdate ( )

Definition at line 65 of file class.ilDclRatingRecordFieldModel.php.

66  {
67  // explicitly do nothing. the value is handled via the model and gui of ilRating.
68  }

◆ getExportValue()

ilDclRatingRecordFieldModel::getExportValue ( )

return Export values

Returns
string

Definition at line 82 of file class.ilDclRatingRecordFieldModel.php.

References ilDclBaseRecordFieldModel\getField(), ilDclBaseRecordFieldModel\getId(), ilRating\getOverallRatingForObject(), and ilDclBaseRecordFieldModel\getRecord().

83  {
84  $val = ilRating::getOverallRatingForObject($this->getRecord()->getId(), "dcl_record", $this->getField()->getId(), "dcl_field");
85 
86  return round($val["avg"], 1) . " (" . $val["cnt"] . ")";
87  }
static getOverallRatingForObject($a_obj_id, $a_obj_type, $a_sub_obj_id=null, $a_sub_obj_type=null, $a_category_id=null)
Get overall rating for an object.
+ Here is the call graph for this function:

◆ getValue()

ilDclRatingRecordFieldModel::getValue ( )
Returns
array

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

References ilDclBaseRecordFieldModel\getField(), ilDclBaseRecordFieldModel\getId(), ilRating\getOverallRatingForObject(), and ilDclBaseRecordFieldModel\getRecord().

94  {
95  return ilRating::getOverallRatingForObject($this->getRecord()->getId(), "dcl_record", $this->getField()->getId(), "dcl_field");
96  }
static getOverallRatingForObject($a_obj_id, $a_obj_type, $a_sub_obj_id=null, $a_sub_obj_type=null, $a_category_id=null)
Get overall rating for an object.
+ Here is the call graph for this function:

◆ loadValue()

ilDclRatingRecordFieldModel::loadValue ( )
protected

override the loadValue.

Definition at line 47 of file class.ilDclRatingRecordFieldModel.php.

48  {
49  // explicitly do nothing. we don't have to load the value as it is saved somewhere else.
50  }

◆ setValue()

ilDclRatingRecordFieldModel::setValue (   $value,
  $omit_parsing = false 
)

Set value for record field.

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

Definition at line 59 of file class.ilDclRatingRecordFieldModel.php.

60  {
61  // explicitly do nothing. the value is handled via the model and gui of ilRating.
62  }

Field Documentation

◆ $dcl_obj_id

ilDclRatingRecordFieldModel::$dcl_obj_id
protected

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

◆ $rated

ilDclRatingRecordFieldModel::$rated
protected

Definition at line 22 of file class.ilDclRatingRecordFieldModel.php.


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