diff --git a/src/Drupal/Driver/Fields/Drupal7/CommerceProductReferenceHandler.php b/src/Drupal/Driver/Fields/Drupal7/CommerceProductReferenceHandler.php new file mode 100644 index 00000000..312263c6 --- /dev/null +++ b/src/Drupal/Driver/Fields/Drupal7/CommerceProductReferenceHandler.php @@ -0,0 +1,28 @@ +fieldInfo['settings']['target_type']; + $entity_info = entity_get_info($entity_type); + + $return = array(); + foreach ($values as $value) { + $product_id = db_select($entity_info['base table'], 't') + ->fields('t', array($entity_info['entity keys']['id'])) + ->condition('t.' . $entity_info['entity keys']['label'], $value) + ->execute()->fetchField(); + if ($product_id) { + $return[$this->language][] = array('product_id' => $product_id); + } + } + return $return; + } +}