Skip to content

Commit

Permalink
Merge pull request #18495 from eileenmcnaughton/email_add
Browse files Browse the repository at this point in the history
dev/core#2046 Rationalise add vs create on email BAO
  • Loading branch information
eileenmcnaughton authored Sep 17, 2020
2 parents ffb8bad + ec47f7b commit 34ea74c
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions CRM/Core/BAO/Email.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,6 @@ public static function create($params) {
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);

Expand Down Expand Up @@ -98,6 +83,20 @@ public static function 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) {
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
Expand Down

0 comments on commit 34ea74c

Please sign in to comment.