本文整理汇总了PHP中CCrmFieldMulti::Add方法的典型用法代码示例。如果您正苦于以下问题:PHP CCrmFieldMulti::Add方法的具体用法?PHP CCrmFieldMulti::Add怎么用?PHP CCrmFieldMulti::Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCrmFieldMulti
的用法示例。
在下文中一共展示了CCrmFieldMulti::Add方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$arFields = array('TYPE_ID' => $typeID, 'SUBJECT' => $subject, 'COMPLETED' => isset($data['completed']) ? intval($data['completed']) > 0 ? 'Y' : 'N' : 'N', 'PRIORITY' => $priority, 'DESCRIPTION' => $descr, 'DESCRIPTION_TYPE' => CCrmContentType::PlainText, 'LOCATION' => $location, 'DIRECTION' => $direction, 'NOTIFY_TYPE' => CCrmActivityNotifyType::None, 'SETTINGS' => array());
$arBindings = array("{$ownerTypeName}_{$ownerID}" => array('OWNER_TYPE_ID' => $ownerTypeID, 'OWNER_ID' => $ownerID));
$notify = isset($data['notify']) ? $data['notify'] : null;
if (is_array($notify)) {
$arFields['NOTIFY_TYPE'] = isset($notify['type']) ? intval($notify['type']) : CCrmActivityNotifyType::Min;
$arFields['NOTIFY_VALUE'] = isset($notify['value']) ? intval($notify['value']) : 15;
}
// Communications
$arComms = array();
if ($commEntityID <= 0 && $commType === 'PHONE' && $ownerTypeName !== 'DEAL') {
// Communication entity ID is 0 (processing of new communications)
// Communication type must present it determines TYPE_ID (is only 'PHONE' in current context)
// Deal does not have multi fields.
$fieldMulti = new CCrmFieldMulti();
$arFieldMulti = array('ENTITY_ID' => $ownerTypeName, 'ELEMENT_ID' => $ownerID, 'TYPE_ID' => 'PHONE', 'VALUE_TYPE' => 'WORK', 'VALUE' => $commValue);
$fieldMultiID = $fieldMulti->Add($arFieldMulti);
if ($fieldMultiID > 0) {
$commEntityType = $ownerTypeName;
$commEntityID = $ownerID;
}
}
if ($commEntityType !== '') {
$arComms[] = array('ID' => $commID, 'TYPE' => $commType, 'VALUE' => $commValue, 'ENTITY_ID' => $commEntityID, 'ENTITY_TYPE_ID' => CCrmOwnerType::ResolveID($commEntityType));
$bindingKey = $commEntityID > 0 ? "{$commEntityType}_{$commEntityID}" : uniqid("{$commEntityType}_");
if (!isset($arBindings[$bindingKey])) {
$arBindings[$bindingKey] = array('OWNER_TYPE_ID' => CCrmOwnerType::ResolveID($commEntityType), 'OWNER_ID' => $commEntityID);
}
}
$isNew = $ID <= 0;
$arPreviousFields = $ID > 0 ? CCrmActivity::GetByID($ID) : array();
$storageTypeID = isset($data['storageTypeID']) ? intval($data['storageTypeID']) : CCrmActivityStorageType::Undefined;