ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilDclRatingRecordFieldModel Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

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

Public Member Functions

 __construct (ilDclBaseRecordModel $record, ilDclBaseFieldModel $field)
 
 addHiddenItemsToConfirmation (ilConfirmationGUI $confirmation)
 
 setValue ($value, bool $omit_parsing=false)
 Set value for record field. More...
 
 doUpdate ()
 
 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, 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 ()
 override the loadValue. More...
 
 doRead ()
 
- Protected Member Functions inherited from ilDclBaseRecordFieldModel
 doRead ()
 Read object data from database. More...
 
 loadValue ()
 Load the value. More...
 

Protected Attributes

int $dcl_obj_id
 
- 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

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning

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

Constructor & Destructor Documentation

◆ __construct()

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

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

References ILIAS\GlobalScreen\Provider\__construct(), ilDclBaseRecordFieldModel\getField(), and ilDclCache\getTableCache().

24  {
25  parent::__construct($record, $field);
26 
27  $dclTable = ilDclCache::getTableCache($this->getField()->getTableId());
28  $this->dcl_obj_id = $dclTable->getCollectionObject()->getId();
29  }
static getTableCache(int $table_id=null)
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ addHiddenItemsToConfirmation()

ilDclRatingRecordFieldModel::addHiddenItemsToConfirmation ( ilConfirmationGUI  $confirmation)

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

31  : void
32  {
33  }

◆ delete()

ilDclRatingRecordFieldModel::delete ( )

delete

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

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

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

◆ doRead()

ilDclRatingRecordFieldModel::doRead ( )
protected

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

58  : void
59  {
60  // explicitly do nothing. the value is handled via the model and gui of ilRating.
61  }

◆ doUpdate()

ilDclRatingRecordFieldModel::doUpdate ( )

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

53  : void
54  {
55  // explicitly do nothing. the value is handled via the model and gui of ilRating.
56  }

◆ getExportValue()

ilDclRatingRecordFieldModel::getExportValue ( )

return Export values

Returns
string

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

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

67  : string
68  {
70  $this->getRecord()->getId(),
71  "dcl_record",
72  $this->getField()->getId(),
73  "dcl_field"
74  );
75 
76  return round($val["avg"], 1) . " (" . $val["cnt"] . ")";
77  }
static getOverallRatingForObject(int $a_obj_id, string $a_obj_type, int $a_sub_obj_id=null, string $a_sub_obj_type=null, int $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 82 of file class.ilDclRatingRecordFieldModel.php.

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

82  : array
83  {
85  $this->getRecord()->getId(),
86  "dcl_record",
87  $this->getField()->getId(),
88  "dcl_field"
89  );
90  }
static getOverallRatingForObject(int $a_obj_id, string $a_obj_type, int $a_sub_obj_id=null, string $a_sub_obj_type=null, int $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 38 of file class.ilDclRatingRecordFieldModel.php.

38  : void
39  {
40  // explicitly do nothing. we don't have to load the value as it is saved somewhere else.
41  }

◆ setValue()

ilDclRatingRecordFieldModel::setValue (   $value,
bool  $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 48 of file class.ilDclRatingRecordFieldModel.php.

48  : void
49  {
50  // explicitly do nothing. the value is handled via the model and gui of ilRating.
51  }

Field Documentation

◆ $dcl_obj_id

int ilDclRatingRecordFieldModel::$dcl_obj_id
protected

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


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