• Модуль: disk
  • Путь к файлу: ~/bitrix/modules/disk/lib/uf/sonetcommentconnector.php
  • Класс: BitrixDiskUfSonetCommentConnector
  • Вызов: SonetCommentConnector::getDataToShowByUser
public function getDataToShowByUser(int $userId)
{
	if(!($comment = $this->loadLogCommentData()))
	{
		return null;
	}

	$return = array();

	if (
		mb_strpos($comment["EVENT_ID"], "crm_") === 0
		&& Loader::includeModule('crm')
	)
	{
		if (mb_strpos($comment["EVENT_ID"], "_message_comment") > 0)
		{
			$connector = new CrmMessageCommentConnector($comment["ID"], $comment["LOG_ID"]);
			$subData = $connector->getDataToShow();
			if($subData["DETAIL_URL"])
			{
				$return["DETAIL_URL"] = $subData["DETAIL_URL"];
			}
			if($subData["DESCRIPTION"])
			{
				$return["DESCRIPTION"] = $subData["DESCRIPTION"];
			}
		}

		$connector = false;

		if ($comment["ENTITY_TYPE"] == CCrmLiveFeedEntity::Deal)
		{
			$connector = new CrmDealConnector($comment["ENTITY_ID"]);
		}
		elseif ($comment["ENTITY_TYPE"] == CCrmLiveFeedEntity::Lead)
		{
			$connector = new CrmLeadConnector($comment["ENTITY_ID"]);
		}
		elseif ($comment["ENTITY_TYPE"] == CCrmLiveFeedEntity::Company)
		{
			$connector = new CrmCompanyConnector($comment["ENTITY_ID"]);
		}
		elseif ($comment["ENTITY_TYPE"] == CCrmLiveFeedEntity::Contact)
		{
			$connector = new CrmContactConnector($comment["ENTITY_ID"]);
		}

		if ($connector)
		{
			$subData = $connector->getDataToShow();
			$return = array_merge($return, $subData);
		}

		return $return;
	}
	else
	{
		return array();
	}
}