本文整理汇总了PHP中CCrmFieldMulti::GetEntityFields方法的典型用法代码示例。如果您正苦于以下问题:PHP CCrmFieldMulti::GetEntityFields方法的具体用法?PHP CCrmFieldMulti::GetEntityFields怎么用?PHP CCrmFieldMulti::GetEntityFields使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCrmFieldMulti
的用法示例。
在下文中一共展示了CCrmFieldMulti::GetEntityFields方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __CrmEventGetPhones
function __CrmEventGetPhones($entityID, $elementID)
{
$result = array();
$arFields = CCrmFieldMulti::GetEntityFields($entityID, $elementID, 'PHONE', true, false);
foreach ($arFields as $arField) {
$result[] = array('TITLE' => $arField['ENTITY_NAME'], 'NUMBER' => $arField['VALUE']);
}
return $result;
}
示例2: RewriteClientFields
public static function RewriteClientFields(&$arFields, $bDualFields = true)
{
$arCompany = $companyEMail = $companyPhone = null;
$arContact = $contactEMail = $contactPhone = null;
$companyId = isset($arFields['COMPANY_ID']) ? intval($arFields['COMPANY_ID']) : 0;
$contactId = isset($arFields['CONTACT_ID']) ? intval($arFields['CONTACT_ID']) : 0;
if ($companyId > 0) {
$arCompany = CCrmCompany::GetByID($companyId);
// Get multifields values (EMAIL and PHONE)
$arFieldsMulti = CCrmFieldMulti::GetEntityFields('COMPANY', $companyId, 'EMAIL', true, false);
if (is_array($arFieldsMulti) && isset($arFieldsMulti[0]['VALUE'])) {
$companyEMail = $arFieldsMulti[0]['VALUE'];
}
$arFieldsMulti = CCrmFieldMulti::GetEntityFields('COMPANY', $companyId, 'PHONE', true, false);
if (is_array($arFieldsMulti) && isset($arFieldsMulti[0]['VALUE'])) {
$companyPhone = $arFieldsMulti[0]['VALUE'];
}
unset($arFieldsMulti);
}
if ($contactId > 0) {
$arContact = CCrmContact::GetByID($contactId);
// Get multifields values (EMAIL and PHONE)
$arFieldsMulti = CCrmFieldMulti::GetEntityFields('CONTACT', $contactId, 'EMAIL', true, false);
if (is_array($arFieldsMulti) && isset($arFieldsMulti[0]['VALUE'])) {
$contactEMail = $arFieldsMulti[0]['VALUE'];
}
$arFieldsMulti = CCrmFieldMulti::GetEntityFields('CONTACT', $contactId, 'PHONE', true, false);
if (is_array($arFieldsMulti) && isset($arFieldsMulti[0]['VALUE'])) {
$contactPhone = $arFieldsMulti[0]['VALUE'];
}
unset($arFieldsMulti);
}
if ($companyId > 0) {
if (is_array($arCompany) && count($arCompany) > 0) {
foreach (self::$clientFields as $k) {
$v = '';
if ($k === 'CLIENT_TITLE') {
if (isset($arCompany['TITLE'])) {
$v = $arCompany['TITLE'];
}
} elseif ($k === 'CLIENT_CONTACT' && $contactId > 0) {
if (isset($arContact['FULL_NAME'])) {
$v = $arContact['FULL_NAME'];
}
} elseif ($k === 'CLIENT_ADDR') {
$v = Bitrix\Crm\Format\CompanyAddressFormatter::format($arCompany, array('TYPE_ID' => \Bitrix\Crm\EntityAddress::Registered));
} elseif ($k === 'CLIENT_EMAIL') {
$v = $contactEMail != '' ? $contactEMail : $companyEMail;
} elseif ($k === 'CLIENT_PHONE') {
$v = $contactPhone != '' ? $contactPhone : $companyPhone;
}
if ($bDualFields) {
$arFields['~' . $k] = $v;
}
$arFields[$k] = $bDualFields ? htmlspecialcharsbx($v) : $v;
}
}
} elseif ($contactId > 0) {
if (is_array($arContact) && count($arContact) > 0) {
foreach (self::$clientFields as $k) {
$v = '';
if ($k === 'CLIENT_TITLE') {
if (isset($arContact['FULL_NAME'])) {
$v = $arContact['FULL_NAME'];
}
} elseif ($k === 'CLIENT_CONTACT' && $contactId > 0) {
$v = '';
} elseif ($k === 'CLIENT_ADDR') {
$v = Bitrix\Crm\Format\ContactAddressFormatter::format($arContact);
} elseif ($k === 'CLIENT_EMAIL') {
$v = $contactEMail;
} elseif ($k === 'CLIENT_PHONE') {
$v = $contactPhone;
}
if ($bDualFields) {
$arFields['~' . $k] = $v;
}
$arFields[$k] = $bDualFields ? htmlspecialcharsbx($v) : $v;
}
}
}
}
示例3: __RewritePayerInfo
public static function __RewritePayerInfo($companyId, $contactId, &$arInvoiceProperties)
{
$arCompany = $companyEMail = $companyPhone = null;
$arContact = $contactEMail = $contactPhone = null;
if ($companyId > 0) {
$arCompany = CCrmCompany::GetByID($companyId);
// Get multifields values (EMAIL and PHONE)
$arFieldsMulti = CCrmFieldMulti::GetEntityFields('COMPANY', $companyId, 'EMAIL', true, false);
if (is_array($arFieldsMulti) && isset($arFieldsMulti[0]['VALUE'])) {
$companyEMail = $arFieldsMulti[0]['VALUE'];
}
$arFieldsMulti = CCrmFieldMulti::GetEntityFields('COMPANY', $companyId, 'PHONE', true, false);
if (is_array($arFieldsMulti) && isset($arFieldsMulti[0]['VALUE'])) {
$companyPhone = $arFieldsMulti[0]['VALUE'];
}
unset($arFieldsMulti);
}
if ($contactId > 0) {
$arContact = CCrmContact::GetByID($contactId);
// Get multifields values (EMAIL and PHONE)
$arFieldsMulti = CCrmFieldMulti::GetEntityFields('CONTACT', $contactId, 'EMAIL', true, false);
if (is_array($arFieldsMulti) && isset($arFieldsMulti[0]['VALUE'])) {
$contactEMail = $arFieldsMulti[0]['VALUE'];
}
$arFieldsMulti = CCrmFieldMulti::GetEntityFields('CONTACT', $contactId, 'PHONE', true, false);
if (is_array($arFieldsMulti) && isset($arFieldsMulti[0]['VALUE'])) {
$contactPhone = $arFieldsMulti[0]['VALUE'];
}
unset($arFieldsMulti);
}
if ($companyId > 0) {
if (is_array($arCompany) && count($arCompany) > 0) {
foreach ($arInvoiceProperties as $propertyKey => $property) {
$curVal = $arInvoiceProperties[$propertyKey]['VALUE'];
if ($property['FIELDS']['CODE'] === 'COMPANY' || $property['FIELDS']['CODE'] === 'COMPANY_NAME') {
if (isset($arCompany['TITLE'])) {
$curVal = $arCompany['TITLE'];
}
} elseif ($property['FIELDS']['CODE'] === 'CONTACT_PERSON' && $contactId > 0) {
if (isset($arContact['FULL_NAME'])) {
$curVal = $arContact['FULL_NAME'];
}
} elseif ($property['FIELDS']['CODE'] === 'COMPANY_ADR') {
$curVal = Bitrix\Crm\Format\CompanyAddressFormatter::format($arCompany, array('TYPE_ID' => \Bitrix\Crm\EntityAddress::Registered));
} elseif ($property['FIELDS']['CODE'] === 'INN') {
$todo = 'todo';
// TODO:
} elseif ($property['FIELDS']['CODE'] === 'KPP') {
$todo = 'todo';
// TODO:
} elseif ($property['FIELDS']['CODE'] === 'EMAIL') {
$curVal = $contactEMail != '' ? $contactEMail : $companyEMail;
} elseif ($property['FIELDS']['CODE'] === 'PHONE') {
$curVal = $contactPhone != '' ? $contactPhone : $companyPhone;
}
$arInvoiceProperties[$propertyKey]['VALUE'] = $curVal;
}
}
} elseif ($contactId > 0) {
if (is_array($arContact) && count($arContact) > 0) {
foreach ($arInvoiceProperties as $propertyKey => $property) {
$curVal = $arInvoiceProperties[$propertyKey]['VALUE'];
if ($property['FIELDS']['CODE'] === 'FIO') {
if (isset($arContact['FULL_NAME'])) {
$curVal = $arContact['FULL_NAME'];
}
} elseif ($property['FIELDS']['CODE'] === 'EMAIL') {
$curVal = $contactEMail;
} elseif ($property['FIELDS']['CODE'] === 'PHONE') {
$curVal = $contactPhone;
} elseif ($property['FIELDS']['CODE'] === 'ADDRESS') {
$curVal = Bitrix\Crm\Format\ContactAddressFormatter::format($arContact);
}
$arInvoiceProperties[$propertyKey]['VALUE'] = $curVal;
}
}
}
}