• Модуль: socialnetwork
  • Путь к файлу: ~/bitrix/modules/socialnetwork/lib/integration/main/ratingvotelist.php
  • Класс: BitrixSocialnetworkIntegrationMainRatingVoteList
  • Вызов: RatingVoteList::onViewed
static function onViewed(Event $event)
{
	$result = new EventResult(
		EventResult::UNDEFINED,
		array(),
		'socialnetwork'
	);

	$entityTypeId = $event->getParameter('entityTypeId');
	$entityId = $event->getParameter('entityId');
	$userId = $event->getParameter('userId');

	if (
		empty($entityTypeId)
		|| intval($entityId) <= 0
		|| intval($userId) <= 0
	)
	{
		return $result;
	}

	if ($liveFeedEntity = Provider::init(array(
		'ENTITY_TYPE' => Provider::DATA_ENTITY_TYPE_RATING_LIST,
		'ENTITY_ID' => $entityTypeId.'|'.$entityId
	)))
	{
		$liveFeedEntity->setContentView(array(
			"user_id" => $userId
		));
	}

	$result = new EventResult(
		EventResult::SUCCESS,
		array(),
		'socialnetwork'
	);

	return $result;
}