...Человеческий поиск в разработке...
- Модуль: crm
- Путь к файлу: ~/bitrix/modules/crm/lib/webform/embed/user.php
- Класс: Bitrix\Crm\WebForm\Embed\User
- Вызов: User::getDataByFieldsMap
static function getDataByFieldsMap($fields, array $map): array { $data = []; if (!is_array($fields)) { return $data; } static $templatedData = null; if ($templatedData === null) { $templatedData = Crm\WebForm\Entity::getMap(); $templatedData = [ 'name' => $templatedData['CONTACT']['FIELD_AUTO_FILL_TEMPLATE']['NAME']['TEMPLATE'], 'company-name' => $templatedData['COMPANY']['FIELD_AUTO_FILL_TEMPLATE']['TITLE']['TEMPLATE'] ]; } if (!Main\Type\Collection::isAssociative($map)) { $map = array_combine($map, $map); } foreach ($map as $fieldKey => $dataKey) { if (empty($fields[$fieldKey]) || !$dataKey) { continue; } if (!empty($templatedData[$dataKey])) { if ($fields[$fieldKey] === $templatedData[$dataKey]) { continue; } } if ($dataKey === 'name' && $fields[$fieldKey] === $templatedData[$dataKey]) { continue; } $data[$dataKey] = $fields[$fieldKey]; } return $data; }