diff --git a/CRM/Core/BAO/Email.php b/CRM/Core/BAO/Email.php index 0dd1bca05a49d314cd910b8415f2e82aa4cba4ba..5854cdb67985babb7cc3b2dcb886d95e2c38aaa4 100644 --- a/CRM/Core/BAO/Email.php +++ b/CRM/Core/BAO/Email.php @@ -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