Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
crm_core
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
crm_core
Commits
62533c68
Commit
62533c68
authored
Apr 17, 2013
by
Kirill Roskolii
Browse files
Options
Downloads
Patches
Plain Diff
Code style cleanup.
parent
22c7c006
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/crm_core_contact/includes/crm_core_contact.controller.inc
+27
-20
27 additions, 20 deletions
...crm_core_contact/includes/crm_core_contact.controller.inc
with
27 additions
and
20 deletions
modules/crm_core_contact/includes/crm_core_contact.controller.inc
+
27
−
20
View file @
62533c68
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
* CRM Contact Entity Class.
* CRM Contact Entity Class.
*/
*/
class
CRMCoreContactEntity
extends
Entity
{
class
CRMCoreContactEntity
extends
Entity
{
protected
function
defaultLabel
()
{
protected
function
defaultLabel
()
{
return
crm_core_contact_label
(
$this
);
return
crm_core_contact_label
(
$this
);
}
}
...
@@ -18,13 +19,19 @@ class CRMCoreContactEntity extends Entity {
...
@@ -18,13 +19,19 @@ class CRMCoreContactEntity extends Entity {
}
}
/**
/**
* Method for de-duplicating contacts
* Method for de-duplicating contacts
.
*
*
* Allows various modules to identify duplicate contact records through
* Allows various modules to identify duplicate contact records through
* hook_crm_core_contact_match. This function should implement it's
* hook_crm_core_contact_match. This function should implement it's
* own contact matching scheme.
* own contact matching scheme.
*
* @param CRMCoreContactEntity $entity
* CRM Core Contact
*
* @return array
* Array of matched contacts.
*/
*/
public
function
match
(
$entity
){
public
function
match
(
CRMCoreContactEntity
$entity
)
{
$checks
=
&
drupal_static
(
__FUNCTION__
);
$checks
=
&
drupal_static
(
__FUNCTION__
);
$matches
=
array
();
$matches
=
array
();
...
@@ -35,9 +42,9 @@ class CRMCoreContactEntity extends Entity {
...
@@ -35,9 +42,9 @@ class CRMCoreContactEntity extends Entity {
$checks
->
processed
=
1
;
$checks
->
processed
=
1
;
}
}
//
p
ass in the contact and the matches array as references.
//
P
ass in the contact and the matches array as references.
//
t
his will allow various matching tools to modify the contact
//
T
his will allow various matching tools to modify the contact
// and the list of matches
// and the list of matches
.
$values
=
array
(
$values
=
array
(
'contact'
=>
&
$entity
,
'contact'
=>
&
$entity
,
'matches'
=>
&
$matches
,
'matches'
=>
&
$matches
,
...
@@ -46,13 +53,11 @@ class CRMCoreContactEntity extends Entity {
...
@@ -46,13 +53,11 @@ class CRMCoreContactEntity extends Entity {
module_invoke
(
$module
,
'crm_core_contact_match'
,
$values
);
module_invoke
(
$module
,
'crm_core_contact_match'
,
$values
);
}
}
//
i
t's up to implementing modules to handle the matching logic.
//
I
t's up to implementing modules to handle the matching logic.
// Most often, the match to be used should be the one
// Most often, the match to be used should be the one
// at the top of the stack.
// at the top of the stack.
return
$matches
;
return
$matches
;
}
}
}
}
/**
/**
...
@@ -63,6 +68,7 @@ class CRMCoreContactEntity extends Entity {
...
@@ -63,6 +68,7 @@ class CRMCoreContactEntity extends Entity {
* special handling for contact objects.
* special handling for contact objects.
*/
*/
class
CRMCoreContactController
extends
EntityAPIController
{
class
CRMCoreContactController
extends
EntityAPIController
{
public
$revisionKey
=
'vid'
;
public
$revisionKey
=
'vid'
;
public
$revisionTable
=
'crm_core_contact_revision'
;
public
$revisionTable
=
'crm_core_contact_revision'
;
...
@@ -88,6 +94,7 @@ class CRMCoreContactController extends EntityAPIController {
...
@@ -88,6 +94,7 @@ class CRMCoreContactController extends EntityAPIController {
protected
function
saveRevision
(
$entity
)
{
protected
function
saveRevision
(
$entity
)
{
$entity
->
log
=
''
;
$entity
->
log
=
''
;
$entity
->
is_new_revision
=
TRUE
;
$entity
->
is_new_revision
=
TRUE
;
return
parent
::
saveRevision
(
$entity
);
return
parent
::
saveRevision
(
$entity
);
}
}
}
}
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