Skip to content

Commit

Permalink
Replaced MatchingRule with Matcher, plugin pattern implementation, fo…
Browse files Browse the repository at this point in the history
…rm, schema, ui changes...
  • Loading branch information
mbovan committed Aug 3, 2015
1 parent 89ef346 commit 21b3560
Show file tree
Hide file tree
Showing 34 changed files with 1,260 additions and 1,191 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
langcode: en
dependencies: { }
id: household
label: Household
plugin_id: default
configuration:
threshold: 0
return_order: created
rules: { }
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
langcode: en
dependencies: { }
id: individual
label: Individual
plugin_id: default
configuration:
threshold: 0
return_order: created
rules: { }
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
langcode: en
dependencies: { }
id: organization
label: Organization
plugin_id: default
configuration:
threshold: 0
return_order: created
rules: { }
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
# Schema for the configuration files of the crm_core_activity module.
# Schema for the configuration files of the crm_core_default_matching_engine module.

crm_core_default_matching_engine.rule.*:
type: config_entity
label: 'Matching rule'
crm_core_match.configuration.default:
type: mapping
mapping:
label:
type: label
label: 'Entity label'
type:
type: string
label: 'Identifier'
threshold:
type: integer
label: 'Match score threshold'
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

use Drupal\Core\Url;
use Drupal\crm_core_contact\Entity\ContactType;
use Drupal\crm_core_default_matching_engine\Entity\MatchingRule;
use Drupal\crm_core_match\Entity\Matcher;

/**
* Implements hook_menu().
Expand Down Expand Up @@ -157,28 +157,13 @@ function crm_core_default_matching_engine_load_field_config($contact_type, $fiel
}
}

/**
* Implements hook_entity_insert().
*
* Create a matching rule for each created contact type.
*/
function crm_core_default_matching_engine_entity_insert(Drupal\Core\Entity\EntityInterface $entity) {
if ($entity->getEntityTypeId() == 'crm_core_contact_type') {
MatchingRule::create(array(
'type' => $entity->id(),
'status' => FALSE,
))
->save();
}
}

/**
* Implements hook_entity_delete().
*
* Remove matching rule for deleted contact type.
*/
function crm_core_default_matching_engine_entity_delete(Drupal\Core\Entity\EntityInterface $entity) {
if ($entity->getEntityTypeId() == 'crm_core_contact_type') {
MatchingRule::load($entity->id())->delete();
Matcher::load($entity->id())->delete();
}
}

This file was deleted.

This file was deleted.

107 changes: 0 additions & 107 deletions modules/crm_core_default_matching_engine/src/Entity/MatchingRule.php

This file was deleted.

Loading

0 comments on commit 21b3560

Please sign in to comment.