...Человеческий поиск в разработке...
- Модуль: crm
- Путь к файлу: ~/bitrix/modules/crm/classes/general/restservice.php
- Класс: \CCrmCompanyRestProxy
- Вызов: CCrmCompanyRestProxy::innerGet
protected function innerGet($ID, &$errors) { if(!CCrmCompany::CheckReadPermission($ID)) { $errors[] = 'Access denied.'; return false; } $dbRes = CCrmCompany::GetListEx( array(), array('=ID' => $ID, '@CATEGORY_ID' => 0,), false, false, array(), array() ); $result = $dbRes ? $dbRes->Fetch() : null; if(!is_array($result)) { $errors[] = 'Not found'; return false; } if($result['IS_MY_COMPANY'] === 'Y') { static::$isMyCompany = true; } $result = \Bitrix\Crm\Entity\CommentsHelper::prepareFieldsFromCompatibleRestToRead( $this->getOwnerTypeID(), $ID, $result, ); $result['FM'] = array(); $fmResult = CCrmFieldMulti::GetList( array('ID' => 'asc'), array( 'ENTITY_ID' => CCrmOwnerType::ResolveName(CCrmOwnerType::Company), 'ELEMENT_ID' => $ID ) ); while($fm = $fmResult->Fetch()) { $fmTypeID = $fm['TYPE_ID']; if(!isset($result['FM'][$fmTypeID])) { $result['FM'][$fmTypeID] = array(); } $result['FM'][$fmTypeID][] = array('ID' => $fm['ID'], 'VALUE_TYPE' => $fm['VALUE_TYPE'], 'VALUE' => $fm['VALUE']); } $userFields = $GLOBALS['USER_FIELD_MANAGER']->GetUserFields(CCrmCompany::$sUFEntityID, $ID, LANGUAGE_ID); foreach($userFields as $ufName => &$ufData) { $result[$ufName] = $ufData['VALUE'] ?? ''; } unset($ufData); return $result; }