Skip to content
Snippets Groups Projects
Commit ec47f7b4 authored by eileen's avatar eileen
Browse files

#2046 Rationalise add vs create on email BAO

This folds the 2 functions into one, deprecating add
parent 907b9f29
Branches
Tags
No related merge requests found
......@@ -36,21 +36,6 @@ class CRM_Core_BAO_Email extends CRM_Core_DAO_Email {
CRM_Core_BAO_Block::handlePrimary($params, get_class());
}
$email = CRM_Core_BAO_Email::add($params);
return $email;
}
/**
* Takes an associative array and adds email.
*
* @param array $params
* (reference ) an assoc array of name/value pairs.
*
* @return object
* CRM_Core_BAO_Email object on success, null otherwise
*/
public static function add(&$params) {
$hook = empty($params['id']) ? 'create' : 'edit';
CRM_Utils_Hook::pre($hook, 'Email', CRM_Utils_Array::value('id', $params), $params);
......@@ -98,6 +83,20 @@ WHERE contact_id = {$params['contact_id']}
return $email;
}
/**
* Takes an associative array and adds email.
*
* @param array $params
* (reference ) an assoc array of name/value pairs.
*
* @return object
* CRM_Core_BAO_Email object on success, null otherwise
*/
public static function add(&$params) {
CRM_Core_Error::deprecatedFunctionWarning('apiv4 create');
return self::create($params);
}
/**
* Given the list of params in the params array, fetch the object
* and store the values in the values array
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment