本文整理汇总了PHP中CCompany::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP CCompany::delete方法的具体用法?PHP CCompany::delete怎么用?PHP CCompany::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCompany
的用法示例。
在下文中一共展示了CCompany::delete方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dPgetParam
$del = dPgetParam($_POST, 'del', 0);
$obj = new CCompany();
$msg = '';
if (!$obj->bind($_POST)) {
$AppUI->setMsg($obj->getError(), UI_MSG_ERROR);
$AppUI->redirect();
}
require_once $AppUI->getSystemClass('CustomFields');
// prepare (and translate) the module name ready for the suffix
$AppUI->setMsg('Company');
if ($del) {
if (!$obj->canDelete($msg)) {
$AppUI->setMsg($msg, UI_MSG_ERROR);
$AppUI->redirect();
}
if ($msg = $obj->delete()) {
$AppUI->setMsg($msg, UI_MSG_ERROR);
$AppUI->redirect();
} else {
$AppUI->setMsg('deleted', UI_MSG_ALERT, true);
$AppUI->redirect('m=companies');
}
} else {
if ($msg = $obj->store()) {
$AppUI->setMsg($msg, UI_MSG_ERROR);
} else {
$custom_fields = new CustomFields($m, 'addedit', $obj->company_id, 'edit');
$custom_fields->bind($_POST);
$sql = $custom_fields->store($obj->company_id);
// Store Custom Fields
$AppUI->setMsg(@$_POST['company_id'] ? 'updated' : 'added', UI_MSG_OK, true);
示例2: die
<?php
/* $Id$ $URL$ */
if (!defined('W2P_BASE_DIR')) {
die('You should not access this file directly.');
}
$del = (int) w2PgetParam($_POST, 'del', 0);
$obj = new CCompany();
if (!$obj->bind($_POST)) {
$AppUI->setMsg($obj->getError(), UI_MSG_ERROR);
$AppUI->redirect();
}
$action = $del ? 'deleted' : 'stored';
$result = $del ? $obj->delete($AppUI) : $obj->store($AppUI);
if (is_array($result)) {
$AppUI->setMsg($result, UI_MSG_ERROR, true);
$AppUI->holdObject($obj);
$AppUI->redirect('m=companies&a=addedit');
}
if ($result) {
$AppUI->setMsg('Company ' . $action, UI_MSG_OK, true);
$AppUI->redirect('m=companies');
} else {
$AppUI->redirect('m=public&a=access_denied');
}