- Модуль: crm
- Путь к файлу: ~/bitrix/modules/crm/lib/order/matcher/fieldmatcher.php
- Класс: Bitrix\Crm\Order\Matcher\FieldMatcher
- Вызов: FieldMatcher::parseGeneralFieldType
static function parseGeneralFieldType($entityTypeId, $entityId, $matches)
{
$entityClassName = static::getEntityClass($entityTypeId);
$dbResult = $entityClassName::GetListEx(
[],
['=ID' => $entityId, 'CHECK_PERMISSIONS' => 'N'],
false,
false,
['*', 'UF_*']
);
$fields = $dbResult->Fetch();
if (!is_array($fields))
{
$fields = [];
}
$values = [];
foreach ($matches as $match)
{
if (isset($fields[$match['CRM_FIELD_CODE']]))
{
if (
(int)$entityTypeId === \CCrmOwnerType::Contact
&& $match['CRM_FIELD_CODE'] === 'FULL_NAME'
)
{
$values[$match['SALE_PROP_ID']] = $entityClassName::PrepareFormattedName(
$fields,
PersonNameFormatter::LastFirstSecondFormat
);
}
else
{
$values[$match['SALE_PROP_ID']] = $fields[$match['CRM_FIELD_CODE']];
}
}
}
return $values;
}