From 85c17e4f3d68d1bda42d1b28e3908b93b0641298 Mon Sep 17 00:00:00 2001
From: Aaron Bauman <aaron@messageagency.com>
Date: Fri, 13 Oct 2017 12:44:18 -0400
Subject: [PATCH] - limit push by bundle

---
 modules/salesforce_push/salesforce_push.module | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/modules/salesforce_push/salesforce_push.module b/modules/salesforce_push/salesforce_push.module
index d707f721..bc41f7e5 100644
--- a/modules/salesforce_push/salesforce_push.module
+++ b/modules/salesforce_push/salesforce_push.module
@@ -59,9 +59,14 @@ function salesforce_push_entity_crud(EntityInterface $entity, $op) {
     return;
   }
 
-  $properties = empty($entity->getEntityTypeId())
-    ? []
-    : ["drupal_entity_type" => $entity->getEntityTypeId()];
+  $properties = [];
+  
+  if ($entity_type = $entity->getEntityTypeId()) {
+    $properties['drupal_entity_type'] = $entity_type;
+  }
+  if ($bundle = $entity->getEntityTypeId()) {
+    $properties['drupal_bundle'] = $bundle;
+  }
   $mappings = \Drupal::service('entity.manager')
     ->getStorage('salesforce_mapping')
     ->loadPushMappingsByProperties($properties);
-- 
GitLab