本文整理汇总了PHP中CRM_Batch_BAO_Batch::deleteBatch方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Batch_BAO_Batch::deleteBatch方法的具体用法?PHP CRM_Batch_BAO_Batch::deleteBatch怎么用?PHP CRM_Batch_BAO_Batch::deleteBatch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Batch_BAO_Batch
的用法示例。
在下文中一共展示了CRM_Batch_BAO_Batch::deleteBatch方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: postProcess
/**
* Process the form submission.
*/
public function postProcess()
{
$params = $this->controller->exportValues($this->_name);
if ($this->_action & CRM_Core_Action::DELETE) {
CRM_Core_Session::setStatus("", ts("Batch Deleted"), "success");
CRM_Batch_BAO_Batch::deleteBatch($this->_id);
return;
}
if ($this->_id) {
$params['id'] = $this->_id;
} else {
$session = CRM_Core_Session::singleton();
$params['created_id'] = $session->get('userID');
$params['created_date'] = CRM_Utils_Date::processDate(date("Y-m-d"), date("H:i:s"));
}
// always create with data entry status
$params['status_id'] = CRM_Core_OptionGroup::getValue('batch_status', 'Data Entry', 'name');
$batch = CRM_Batch_BAO_Batch::create($params);
// redirect to batch entry page.
$session = CRM_Core_Session::singleton();
if ($this->_action & CRM_Core_Action::ADD) {
$session->replaceUserContext(CRM_Utils_System::url('civicrm/batch/entry', "id={$batch->id}&reset=1&action=add"));
} else {
$session->replaceUserContext(CRM_Utils_System::url('civicrm/batch/entry', "id={$batch->id}&reset=1"));
}
}