Skip to content
Snippets Groups Projects
Unverified Commit 34ea74cf authored by Eileen McNaughton's avatar Eileen McNaughton Committed by GitHub
Browse files

Merge pull request #18495 from eileenmcnaughton/email_add

#2046 Rationalise add vs create on email BAO
parents ffb8bad4 ec47f7b4
No related branches found
No related tags found
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.
Finish editing this message first!
Please register or to comment