*/
public static function create(&$params) {
$id = $params['id'] ?? NULL;
- if ($id) {
- CRM_Utils_Hook::pre('edit', 'LineItem', $id, $params);
- }
- else {
- CRM_Utils_Hook::pre('create', 'LineItem', $id, $params);
- }
// unset entity table and entity id in $params
// we never update the entity table and entity id during update mode
$params['tax_amount'] = self::getTaxAmountForLineItem($params);
}
+ // Call the hooks after tax is set in case hooks wish to alter it.
+ if ($id) {
+ CRM_Utils_Hook::pre('edit', 'LineItem', $id, $params);
+ }
+ else {
+ CRM_Utils_Hook::pre('create', 'LineItem', $id, $params);
+ }
$lineItemBAO = new CRM_Price_BAO_LineItem();
$lineItemBAO->copyValues($params);
* @param array $params
* Form values.
*
- * @param string $entityId
+ * @param string[]|null $entityId
* Entity id.
*
* @param string $entityTable