3 +--------------------------------------------------------------------+
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2018 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
31 * @copyright CiviCRM LLC (c) 2004-2018
33 class CRM_Batch_BAO_EntityBatch
extends CRM_Batch_DAO_EntityBatch
{
36 * Create entity batch entry.
38 * @param array $params
41 public static function create(&$params) {
43 $entityId = CRM_Utils_Array
::value('id', $params);
47 CRM_Utils_Hook
::pre($op, 'EntityBatch', $entityId, $params);
48 $entityBatch = new CRM_Batch_DAO_EntityBatch();
49 $entityBatch->copyValues($params);
51 CRM_Utils_Hook
::post($op, 'EntityBatch', $entityBatch->id
, $entityBatch);
56 * Remove entries from entity batch.
57 * @param array|int $params
58 * @return CRM_Batch_DAO_EntityBatch
60 public static function del($params) {
61 if (!is_array($params)) {
62 $params = array('id' => $params);
64 $entityBatch = new CRM_Batch_DAO_EntityBatch();
65 $entityId = CRM_Utils_Array
::value('id', $params);
66 CRM_Utils_Hook
::pre('delete', 'EntityBatch', $entityId, $params);
67 $entityBatch->copyValues($params);
68 $entityBatch->delete();
69 CRM_Utils_Hook
::post('delete', 'EntityBatch', $entityBatch->id
, $entityBatch);