Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
CiviCRM Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Development
CiviCRM Core
Commits
ec47f7b4
Commit
ec47f7b4
authored
4 years ago
by
eileen
Browse files
Options
Downloads
Patches
Plain Diff
#2046
Rationalise add vs create on email BAO
This folds the 2 functions into one, deprecating add
parent
907b9f29
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
CRM/Core/BAO/Email.php
+14
-15
14 additions, 15 deletions
CRM/Core/BAO/Email.php
with
14 additions
and
15 deletions
CRM/Core/BAO/Email.php
+
14
−
15
View file @
ec47f7b4
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment