本文整理汇总了PHP中CRM_Batch_BAO_Batch::removeBatchEntity方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Batch_BAO_Batch::removeBatchEntity方法的具体用法?PHP CRM_Batch_BAO_Batch::removeBatchEntity怎么用?PHP CRM_Batch_BAO_Batch::removeBatchEntity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Batch_BAO_Batch
的用法示例。
在下文中一共展示了CRM_Batch_BAO_Batch::removeBatchEntity方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: bulkAssignRemove
public static function bulkAssignRemove()
{
$checkIDs = $_REQUEST['ID'];
$entityID = CRM_Utils_Type::escape($_REQUEST['entityID'], 'String');
$action = CRM_Utils_Type::escape($_REQUEST['action'], 'String');
foreach ($checkIDs as $key => $value) {
if (substr($value, 0, 7) == "mark_x_" && $action == 'Assign' || substr($value, 0, 7) == "mark_y_" && $action == 'Remove') {
$contributions = explode("_", $value);
$cIDs[] = $contributions[2];
}
}
$batchPID = CRM_Core_DAO::getFieldValue('CRM_Batch_DAO_Batch', $entityID, 'payment_instrument_id');
$paymentInstrument = CRM_Core_OptionGroup::getLabel('payment_instrument', $batchPID);
foreach ($cIDs as $key => $value) {
$recordPID = CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_FinancialTrxn', $value, 'payment_instrument_id');
if ($action == 'Remove' || $recordPID == $batchPID && $action == 'Assign' || !isset($batchPID)) {
$params = array('entity_id' => $value, 'entity_table' => 'civicrm_financial_trxn', 'batch_id' => $entityID);
if ($action == 'Assign') {
$updated = CRM_Batch_BAO_Batch::addBatchEntity($params);
} else {
$updated = CRM_Batch_BAO_Batch::removeBatchEntity($params);
}
}
}
if ($updated) {
$status = array('status' => 'record-updated-success');
} else {
$status = array('status' => ts("This batch is configured to include only transactions using %1 payment method. If you want to include other transactions, please edit the batch first and modify the Payment Method.", array(1 => $paymentInstrument)));
}
CRM_Utils_JSON::output($status);
}