- Модуль: main
- Путь к файлу: ~/bitrix/modules/main/lib/rest/rating.php
- Класс: BitrixMainRestRating
- Вызов: Rating::getLikeReactions
static function getLikeReactions($query, $nav = 0, CRestServer $server)
{
$query = array_change_key_case($query, CASE_LOWER);
$entityTypeId = ($query['entity_type_id'] ?? '');
$entityId = (isset($query['entity_id']) ? intval($query['entity_id']) : 0);
if(
empty($entityTypeId)
|| $entityId <= 0
)
{
throw new RestRestException("Wrong entity data.", RestRestException::ERROR_ARGUMENT, CRestServer::STATUS_WRONG_REQUEST);
}
$reactionResult = CRatings::getRatingVoteReaction(array(
"ENTITY_TYPE_ID" => $entityTypeId,
"ENTITY_ID" => $entityId,
"USE_REACTIONS_CACHE" => 'Y'
));
return $reactionResult['reactions'];
}