<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.5 |
+ | CiviCRM version 4.6 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
class CRM_Financial_BAO_FinancialItem extends CRM_Financial_DAO_FinancialItem {
/**
- * class constructor
+ * Class constructor
*/
function __construct( ) {
parent::__construct( );
}
/**
- * add the financial items and financial trxn
+ * Add the financial items and financial trxn
*
* @param object $lineItem line item object
* @param object $contribution contribution object
}
/**
- * create the financial Items and financial enity trxn
+ * Create the financial Items and financial enity trxn
*
* @param array $params associated array to create financial items
* @param array $ids financial item ids
*/
static function create(&$params, $ids = NULL, $trxnIds = NULL) {
$financialItem = new CRM_Financial_DAO_FinancialItem();
+
+ if (!empty($ids['id'])) {
+ CRM_Utils_Hook::pre('edit', 'FinancialItem', $ids['id'], $params);
+ }
+ else {
+ CRM_Utils_Hook::pre('create', 'FinancialItem', NULL, $params);
+ }
+
$financialItem->copyValues($params);
if (!empty($ids['id'])) {
$financialItem->id = $ids['id'];
}
$entity_trxn->save();
}
+ if (!empty($ids['id'])) {
+ CRM_Utils_Hook::post('edit', 'FinancialItem', $financialItem->id, $financialItem);
+ }
+ else {
+ CRM_Utils_Hook::post('create', 'FinancialItem', $financialItem->id, $financialItem);
+ }
return $financialItem;
}
/**
- * takes an associative array and creates a entity financial transaction object
+ * Takes an associative array and creates a entity financial transaction object
*
* @param array $params (reference ) an assoc array of name/value pairs
*
}
/**
- * retrive entity financial trxn details
+ * Retrive entity financial trxn details
*
* @param array $params (reference ) an assoc array of name/value pairs
* @param bool $maxId to retrive max id
}
/**
- * check if contact is present in financial_item table
+ * Check if contact is present in financial_item table
*
* CRM-12929
*