Documentation

GetRatingVoteResult

array
CRatings::GetRatingVoteResult(
 int entityTypeId,
 mixed entityId
 int user_Id
);

The method returns the rating votes for the entityTypeId entity and the entityId. Non-static method.

Method parameters

Parameter Description
entityTypeId Vote entity name. For example: FORUM_TOPIC for forum topics, FORUM_POST for forum posts, BLOG_POST for blog posts, BLOG_COMMENT for blog comments. The list of codes is not restricted, any suitable code can be used.
entityId Vote entity ID (several results can be selected, by specifying the array of IDs in this parameter)
user_Id User ID (if not set, the current user is specified)

See Also

Examples of use

<?
$entityTypeId = 'FORUM_TOPIC';
$entityId = 38;
$arVoteResult = CRatings::GetRatingVoteResult($entityTypeId, $entityId);
if(!empty($arVoteResult))
    echo '<pre>'.print_r($arVoteResult, true).'</pre>';
else
    echo "Forum: no votes for selected topic yet"; 
?>


© «Bitrix24», 2001-2022
Up