Documentation

Update

bool
CRatings::Update(
 int id,
 array fields
);

The method updates parameters of the rating with ID. Non-static method.

Method parameters

Parameter Description
id Rating ID.
fields Array of parameter values. The following values can be used as the keys for this array:
  • NAME – rating name
  • ACTIVE – rating active status (Y|N)
  • ENTITY_ID – rated object (for example: USER, BLOG, and etc.)
  • CALCULATION_METHOD – type of rating calculation (SUM- sum of criteria, AVG – average criteria value)
  • CONFIGS – array, describing the rating criteria
  • NEW_CALC – resets the previous rating value

See Also

Examples of use

<?
// update the rating name and make it active
$arUpdateRating = array(
	'ACTIVE' => 'N',
	'NAME' => 'Rating, updated via API',
);
$result = CRatings::Update(1, $arUpdateRating);
if ($result)
    echo "Rating is updated successfully.";
?>


© «Bitrix24», 2001-2024
Up