ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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)
 
 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 31 of file class.ilDclRatingRecordFieldModel.php.

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

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

Member Function Documentation

◆ addHiddenItemsToConfirmation()

ilDclRatingRecordFieldModel::addHiddenItemsToConfirmation ( ilConfirmationGUI $confirmation)

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

39  {
40  return;
41  }

◆ delete()

ilDclRatingRecordFieldModel::delete ( )

delete

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

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

89  {
90  global $DIC;
91  $ilDB = $DIC['ilDB'];
92 
93  $ilDB->manipulate("DELETE FROM il_rating WHERE ".
94  "obj_id = ".$ilDB->quote((int) $this->getRecord()->getId(), "integer")." AND ".
95  "obj_type = ".$ilDB->quote("dcl_record", "text")." AND ".
96  "sub_obj_id = ".$ilDB->quote((int) $this->getField()->getId(), "integer")." AND ".
97  $ilDB->equals("sub_obj_type", "dcl_field", "text", true));
98 
99  $query2 = "DELETE FROM il_dcl_record_field WHERE id = ".$ilDB->quote($this->getId(), "integer");
100  $ilDB->manipulate($query2);
101  }
global $ilDB
global $DIC
+ Here is the call graph for this function:

◆ doRead()

ilDclRatingRecordFieldModel::doRead ( )

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

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

◆ doUpdate()

ilDclRatingRecordFieldModel::doUpdate ( )

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

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

◆ getExportValue()

ilDclRatingRecordFieldModel::getExportValue ( )

return Export values

Returns
string

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

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

73  {
74  $val = ilRating::getOverallRatingForObject($this->getRecord()->getId(), "dcl_record", $this->getField()->getId(), "dcl_field");
75  return round($val["avg"],1)." (".$val["cnt"].")";
76  }
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 81 of file class.ilDclRatingRecordFieldModel.php.

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

81  {
82  return ilRating::getOverallRatingForObject($this->getRecord()->getId(), "dcl_record", $this->getField()->getId(), "dcl_field");
83  }
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.

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

◆ 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 57 of file class.ilDclRatingRecordFieldModel.php.

57  {
58  // explicitly do nothing. the value is handled via the model and gui of ilRating.
59  }

Field Documentation

◆ $dcl_obj_id

ilDclRatingRecordFieldModel::$dcl_obj_id
protected

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

◆ $rated

ilDclRatingRecordFieldModel::$rated
protected

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


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