本文整理汇总了PHP中CCrmContact::GetById方法的典型用法代码示例。如果您正苦于以下问题:PHP CCrmContact::GetById方法的具体用法?PHP CCrmContact::GetById怎么用?PHP CCrmContact::GetById使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCrmContact
的用法示例。
在下文中一共展示了CCrmContact::GetById方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fillFilterReferenceColumn
public static function fillFilterReferenceColumn(&$filterElement, &$field)
{
if ($field->getRefEntityName() == '\\Bitrix\\Crm\\Company') {
// CrmCompany
if ($filterElement['value']) {
$entity = CCrmCompany::GetById($filterElement['value']);
if ($entity) {
$filterElement['value'] = array('id' => $entity['ID'], 'name' => $entity['TITLE']);
} else {
$filterElement['value'] = array('id' => $filterElement['value'], 'name' => GetMessage('CRM_COMPANY_NOT_FOUND'));
}
} else {
$filterElement['value'] = array('id' => '');
}
} elseif ($field->getRefEntityName() == '\\Bitrix\\Crm\\Contact') {
// CrmContact
if ($filterElement['value']) {
$entity = CCrmContact::GetById($filterElement['value']);
if ($entity) {
$filterElement['value'] = array('id' => $entity['ID'], 'name' => $entity['FULL_NAME']);
} else {
$filterElement['value'] = array('id' => $filterElement['value'], 'name' => GetMessage('CRM_CONTACT_NOT_FOUND'));
}
} else {
$filterElement['value'] = array('id' => '');
}
} elseif ($field->getRefEntityName() == '\\Bitrix\\Crm\\Invoice') {
// CrmInvoice
if ($filterElement['value']) {
$entity = CCrmInvoice::GetById($filterElement['value']);
if ($entity) {
$filterElement['value'] = array('id' => $entity['ID'], 'name' => $entity['ORDER_TOPIC']);
} else {
$filterElement['value'] = array('id' => $filterElement['value'], 'name' => GetMessage('CRM_INVOICE_NOT_FOUND'));
}
} else {
$filterElement['value'] = array('id' => '');
}
} elseif ($field->getRefEntityName() == '\\Bitrix\\Crm\\Deal') {
// CrmDeal
if ($filterElement['value']) {
$entity = CCrmDeal::GetById($filterElement['value']);
if ($entity) {
$filterElement['value'] = array('id' => $entity['ID'], 'name' => $entity['TITLE']);
} else {
$filterElement['value'] = array('id' => $filterElement['value'], 'name' => GetMessage('CRM_DEAL_NOT_FOUND'));
}
} else {
$filterElement['value'] = array('id' => '');
}
} elseif ($field->getRefEntityName() == '\\Bitrix\\Crm\\Lead') {
// CrmLead
if ($filterElement['value']) {
$entity = CCrmLead::GetById($filterElement['value']);
if ($entity) {
$filterElement['value'] = array('id' => $entity['ID'], 'name' => $entity['TITLE']);
} else {
$filterElement['value'] = array('id' => $filterElement['value'], 'name' => GetMessage('CRM_LEAD_NOT_FOUND'));
}
} else {
$filterElement['value'] = array('id' => '');
}
}
parent::fillFilterReferenceColumn($filterElement, $field);
}