ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 30 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.

40  {
41  return;
42  }

◆ delete()

ilDclRatingRecordFieldModel::delete ( )

delete

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

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

96  {
97  global $DIC;
98  $ilDB = $DIC['ilDB'];
99 
100  $ilDB->manipulate("DELETE FROM il_rating WHERE " .
101  "obj_id = " . $ilDB->quote((int) $this->getRecord()->getId(), "integer") . " AND " .
102  "obj_type = " . $ilDB->quote("dcl_record", "text") . " AND " .
103  "sub_obj_id = " . $ilDB->quote((int) $this->getField()->getId(), "integer") . " AND " .
104  $ilDB->equals("sub_obj_type", "dcl_field", "text", true));
105 
106  $query2 = "DELETE FROM il_dcl_record_field WHERE id = " . $ilDB->quote($this->getId(), "integer");
107  $ilDB->manipulate($query2);
108  }
global $DIC
Definition: saml.php:7
global $ilDB
+ Here is the call graph for this function:

◆ doRead()

ilDclRatingRecordFieldModel::doRead ( )

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

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

◆ doUpdate()

ilDclRatingRecordFieldModel::doUpdate ( )

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

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

◆ getExportValue()

ilDclRatingRecordFieldModel::getExportValue ( )

return Export values

Returns
string

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

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

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

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

88  {
89  return ilRating::getOverallRatingForObject($this->getRecord()->getId(), "dcl_record", $this->getField()->getId(), "dcl_field");
90  }
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 48 of file class.ilDclRatingRecordFieldModel.php.

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

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

◆ $rated

ilDclRatingRecordFieldModel::$rated
protected

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


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