• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/update/userfield/crmcontactfield.php
  • Класс: Bitrix\Crm\Update\UserField\CrmContactField
  • Вызов: CrmContactField::getListUfFieldsForCheck
protected function getListUfFieldsForCheck($entityId)
{
	$queryObject = \CUserTypeEntity::getList(array(), array("ENTITY_ID" => $entityId, "USER_TYPE_ID" => "crm"));
	$listUfFieldsForCheck = array();
	while($listUfFields = $queryObject->fetch())
	{
		if(is_array($listUfFields["SETTINGS"]))
		{
			$tmpArray = array_filter($listUfFields["SETTINGS"], function($mark){
				return $mark == "Y";
			});
			if(count($tmpArray) == 1)
			{
				$listUfFieldsForCheck[$listUfFields["ID"]]= array(
					"ENTITY_ID" => $listUfFields["ENTITY_ID"],
					"FIELD_NAME" => $listUfFields["FIELD_NAME"],
					"AVAILABLE_ENTITY_TYPE" => array_search("Y", $tmpArray)
				);
			}
		}
	}

	return $listUfFieldsForCheck;
}