...Человеческий поиск в разработке...
- Модуль: crm
- Путь к файлу: ~/bitrix/modules/crm/classes/general/crm_email.php
- Класс: \CCrmEMail
- Вызов: CCrmEMail::ExtractCommsFromEmails
static function ExtractCommsFromEmails($emails, $arIgnored = array()) { if(!is_array($emails)) { $emails = array($emails); } if(count($emails) === 0) { return array(); } $arFilter = array(); foreach ($emails as $email) { //Process valid emails only if(!($email !== '' && CCrmMailHelper::IsEmail($email))) { continue; } if(in_array($email, $arIgnored, true)) { continue; } $arFilter[] = array('RAW_VALUE' => $email); } if(empty($arFilter)) { return array(); } $dbFieldMulti = CCrmFieldMulti::GetList( array(), array( 'ENTITY_ID' => 'LEAD|CONTACT|COMPANY', 'TYPE_ID' => 'EMAIL', 'FILTER' => $arFilter ) ); $result = array(); while($arFieldMulti = $dbFieldMulti->Fetch()) { $entityTypeID = CCrmOwnerType::ResolveID($arFieldMulti['ENTITY_ID']); $entityID = intval($arFieldMulti['ELEMENT_ID']); $result[] = self::CreateComm($entityTypeID, $entityID, $arFieldMulti['VALUE']); } return $result; }