ILIAS  trunk Revision v11.0_alpha-1831-g8615d53dadb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilDclRatingRecordFieldModel Class Reference
+ 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

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

Constructor & Destructor Documentation

◆ __construct()

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

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

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

26  {
27  parent::__construct($record, $field);
28 
29  $dclTable = ilDclCache::getTableCache($this->getField()->getTableId());
30  $this->dcl_obj_id = $dclTable->getCollectionObject()->getId();
31  }
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 33 of file class.ilDclRatingRecordFieldModel.php.

33  : void
34  {
35  }

◆ delete()

ilDclRatingRecordFieldModel::delete ( )

delete

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

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

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

◆ doRead()

ilDclRatingRecordFieldModel::doRead ( )
protected

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

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

◆ doUpdate()

ilDclRatingRecordFieldModel::doUpdate ( )

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

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

◆ getExportValue()

ilDclRatingRecordFieldModel::getExportValue ( )

return Export values

Returns
string

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

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

69  : string
70  {
72  $this->getRecord()->getId(),
73  "dcl_record",
74  (int) $this->getField()->getId(),
75  "dcl_field"
76  );
77 
78  return round($val["avg"], 1) . " (" . $val["cnt"] . ")";
79  }
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 84 of file class.ilDclRatingRecordFieldModel.php.

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

84  : array
85  {
87  $this->getRecord()->getId(),
88  "dcl_record",
89  (int) $this->getField()->getId(),
90  "dcl_field"
91  );
92  }
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 40 of file class.ilDclRatingRecordFieldModel.php.

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

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

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

Field Documentation

◆ $dcl_obj_id

int ilDclRatingRecordFieldModel::$dcl_obj_id
protected

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


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