CAllCrmDeal::BuildEntityAttr

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. CAllCrmDeal
  4. BuildEntityAttr
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/classes/general/crm_deal.php
  • Класс: \CAllCrmDeal
  • Вызов: CAllCrmDeal::BuildEntityAttr
public function BuildEntityAttr($userID, $arAttr = array())
{
	$userID = (int)$userID;
	$arResult = array("U{$userID}");
	if(isset($arAttr['OPENED']) && $arAttr['OPENED'] == 'Y')
	{
		$arResult[] = 'O';
	}

	$stageID = isset($arAttr['STAGE_ID']) ? $arAttr['STAGE_ID'] : '';
	if($stageID !== '')
	{
		$arResult[] = "STAGE_ID{$stageID}";
	}

	if(isset($arAttr['CONCERNED_USER_IDS']) && is_array($arAttr['CONCERNED_USER_IDS']))
	{
		foreach($arAttr['CONCERNED_USER_IDS'] as $concernedUserID)
		{
			$arResult[] = "CU{$concernedUserID}";
		}
	}

	$arUserAttr = Bitrix\Crm\Service\Container::getInstance()
		->getUserPermissions($userID)
		->getAttributesProvider()
		->getEntityAttributes()
	;

	return array_merge($arResult, $arUserAttr['INTRANET']);
}

Добавить комментарий