ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilDataCollectionRatingField Class Reference

Class ilDataCollectionField. More...

+ Inheritance diagram for ilDataCollectionRatingField:
+ Collaboration diagram for ilDataCollectionRatingField:

Public Member Functions

 __construct (ilDataCollectionRecord $record, ilDataCollectionField $field)
 setValue ($value)
 doUpdate ()
 doRead ()
 getFormInput ()
 getHTML ()
 getExportValue ()
 getValue ()
 delete ()
 delete
- Public Member Functions inherited from ilDataCollectionRecordField
 getPlainText ()
 getSingleHTML ($link=null)
 this funciton is used to in the viewdefinition of a single record.
 getField ()
 getId ()
 getRecord ()

Protected Member Functions

 loadValue ()
 override the loadValue.

Protected Attributes

 $rated
 $dcl_obj_id
- Protected Attributes inherited from ilDataCollectionRecordField
 $id
 $field
 $record
 $value

Detailed Description

Constructor & Destructor Documentation

ilDataCollectionRatingField::__construct ( ilDataCollectionRecord  $record,
ilDataCollectionField  $field 
)

Reimplemented from ilDataCollectionRecordField.

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

References ilDataCollectionRecordField\getField(), and ilDataCollectionCache\getTableCache().

{
parent::__construct($record, $field);
$dclTable = ilDataCollectionCache::getTableCache($this->getField()->getTableId());
$this->dcl_obj_id = $dclTable->getCollectionObject()->getId();
}

+ Here is the call graph for this function:

Member Function Documentation

ilDataCollectionRatingField::delete ( )

delete

Reimplemented from ilDataCollectionRecordField.

Definition at line 87 of file class.ilDataCollectionRatingField.php.

References ilDataCollectionRecordField\getField(), and ilDataCollectionRecordField\getId().

{
global $ilDB;
$ilDB->manipulate("DELETE FROM il_rating WHERE ".
"obj_id = ".$ilDB->quote((int) $this->getRecord()->getId(), "integer")." AND ".
"obj_type = ".$ilDB->quote("dcl_record", "text")." AND ".
"sub_obj_id = ".$ilDB->quote((int) $this->getField()->getId(), "integer")." AND ".
$ilDB->equals("sub_obj_type", "dcl_field", "text", true));
$query2 = "DELETE FROM il_dcl_record_field WHERE id = ".$ilDB->quote($this->getId(), "integer");
$ilDB->manipulate($query2);
}

+ Here is the call graph for this function:

ilDataCollectionRatingField::doRead ( )

Reimplemented from ilDataCollectionRecordField.

Definition at line 52 of file class.ilDataCollectionRatingField.php.

{
// explicitly do nothing. the value is handled via the model and gui of ilRating.
}
ilDataCollectionRatingField::doUpdate ( )

Reimplemented from ilDataCollectionRecordField.

Definition at line 48 of file class.ilDataCollectionRatingField.php.

{
// explicitly do nothing. the value is handled via the model and gui of ilRating.
}
ilDataCollectionRatingField::getExportValue ( )

Reimplemented from ilDataCollectionRecordField.

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

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

{
$val = ilRating::getOverallRatingForObject($this->getRecord()->getId(), "dcl_record",
$this->getField()->getId(), "dcl_field");
return round($val["avg"],1)." (".$val["cnt"].")";
}

+ Here is the call graph for this function:

ilDataCollectionRatingField::getFormInput ( )

Reimplemented from ilDataCollectionRecordField.

Definition at line 56 of file class.ilDataCollectionRatingField.php.

References $lng.

{
global $lng;
return $lng->txt("dcl_editable_in_table_gui");
}
ilDataCollectionRatingField::getHTML ( )

Reimplemented from ilDataCollectionRecordField.

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

References $ilCtrl, ilDataCollectionRecordField\getField(), ilDataCollectionRecordField\getId(), and ilDataCollectionRecordField\getRecord().

{
global $ilCtrl;
$rgui = new ilRatingGUI();
$rgui->setObject($this->getRecord()->getId(), "dcl_record",
$this->getField()->getId(), "dcl_field");
$ilCtrl->setParameterByClass("ilratinggui", "field_id", $this->getField()->getId());
$ilCtrl->setParameterByClass("ilratinggui", "record_id", $this->getRecord()->getId());
$html = $rgui->getHTML();
return $html;
}

+ Here is the call graph for this function:

ilDataCollectionRatingField::getValue ( )

Reimplemented from ilDataCollectionRecordField.

Definition at line 79 of file class.ilDataCollectionRatingField.php.

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

{
return ilRating::getOverallRatingForObject($this->getRecord()->getId(), "dcl_record",
$this->getField()->getId(), "dcl_field");
}

+ Here is the call graph for this function:

ilDataCollectionRatingField::loadValue ( )
protected

override the loadValue.

Reimplemented from ilDataCollectionRecordField.

Definition at line 40 of file class.ilDataCollectionRatingField.php.

{
// explicitly do nothing. we don't have to load the value as it is saved somewhere else.
}
ilDataCollectionRatingField::setValue (   $value)

Reimplemented from ilDataCollectionRecordField.

Definition at line 44 of file class.ilDataCollectionRatingField.php.

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

Field Documentation

ilDataCollectionRatingField::$dcl_obj_id
protected

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

ilDataCollectionRatingField::$rated
protected

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


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