• Модуль: socialnetwork
  • Путь к файлу: ~/bitrix/modules/socialnetwork/classes/general/log_comments.php
  • Класс: CAllSocNetLogComments
  • Вызов: CAllSocNetLogComments::SetSource
static function SetSource($arFields, $action = false)
{
	$arCallback = false;

	if (!$action)
	{
		$action = "ADD";
	}

	if (!in_array($action, array("ADD", "UPDATE", "DELETE")))
	{
		return false;
	}

	$arEvent = CSocNetLogTools::FindLogCommentEventByID($arFields["EVENT_ID"]);
	if ($arEvent)
	{
		$arCallback = $arEvent[$action."_CALLBACK"];
	}

	if (
		$arCallback
		&& is_callable($arCallback)
	)
	{
		$arSource = call_user_func_array($arCallback, array($arFields));
	}

	return $arSource;
}