本文整理匯總了PHP中CCrmStatus::Delete方法的典型用法代碼示例。如果您正苦於以下問題:PHP CCrmStatus::Delete方法的具體用法?PHP CCrmStatus::Delete怎麽用?PHP CCrmStatus::Delete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CCrmStatus
的用法示例。
在下文中一共展示了CCrmStatus::Delete方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: trim
if ($arField['SORT'] <= $iPrevSort) {
$arField['SORT'] = $iPrevSort + 10;
}
$iPrevSort = $arField['SORT'];
if (substr($id, 0, 1) == 'n') {
if (trim($arField['VALUE']) == "") {
continue;
}
$arAdd['NAME'] = trim($arField['VALUE']);
$arAdd['SORT'] = $arField['SORT'];
$CCrmStatus->Add($arAdd);
} else {
if (!isset($arField['VALUE']) || trim($arField['VALUE']) == "") {
$arCurrentData = $CCrmStatus->GetStatusById($id);
if ($arCurrentData['SYSTEM'] == 'N') {
$CCrmStatus->Delete($id);
} else {
$arUpdate['NAME'] = trim($arCurrentData['NAME_INIT']);
$CCrmStatus->Update($id, $arUpdate);
}
} else {
$arCurrentData = $CCrmStatus->GetStatusById($id);
if (trim($arField['VALUE']) != $arCurrentData['NAME'] || intval($arField['SORT']) != $arCurrentData['SORT']) {
$arUpdate['NAME'] = trim($arField['VALUE']);
$arUpdate['SORT'] = $arField['SORT'];
$CCrmStatus->Update($id, $arUpdate);
}
}
}
}
}
示例2: innerDelete
protected function innerDelete($ID, &$errors)
{
if (!CCrmStatus::CheckDeletePermission($ID)) {
$errors[] = 'Access denied.';
return false;
}
$dbResult = CCrmStatus::GetList(array(), array('ID' => $ID));
$currentFields = $dbResult ? $dbResult->Fetch() : null;
if (!is_array($currentFields)) {
$errors[] = 'CRM Status is not found.';
return false;
}
$entity = new CCrmStatus($currentFields['ENTITY_ID']);
$result = $entity->Delete($ID);
if ($result === false) {
$errors[] = $entity->GetLastError();
}
return $result !== false;
}