CCrmRequisitePresetFieldRestProxy::getByFieldId

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. CCrmRequisitePresetFieldRestProxy
  4. getByFieldId
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/classes/general/restservice.php
  • Класс: \CCrmRequisitePresetFieldRestProxy
  • Вызов: CCrmRequisitePresetFieldRestProxy::getByFieldId
protected function getByFieldId($id, $fields, $option = array())
{
	$requisite = self::getOwnerEntity();

	$result = array();
	$presetCountryId = isset($option['COUNTRY_ID']) ? (int)$option['COUNTRY_ID'] : 0;
	$fieldsTitles = $requisite->getFieldsTitles($presetCountryId);
	foreach ($fields as $fieldInfo)
	{
		if (isset($fieldInfo['ID']) && $id === (int)$fieldInfo['ID'])
		{
			$result = $fieldInfo;
			if($result['FIELD_TITLE'] == '')
			{
				if (isset($fieldInfo['FIELD_NAME']) && !empty($fieldInfo['FIELD_NAME']))
				{
					if (isset($fieldsTitles[$fieldInfo['FIELD_NAME']]))
					{
						$title = $fieldsTitles[$fieldInfo['FIELD_NAME']];
						if (!empty($title))
							$result['FIELD_TITLE'] = $title;
					}
				}
			}
			break;
		}
	}
	return $result;
}

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