diff --git a/feeds.api.php b/feeds.api.php index 93b1e9e..6ee490a 100644 --- a/feeds.api.php +++ b/feeds.api.php @@ -271,10 +271,10 @@ function my_source_get_source(FeedsSource $source, FeedsParserResult $result, $k * Remove with caution. * @param $entity_type * The entity type of the target, for instance a 'node' entity. - * @param $bundle_name + * @param $bundle * The bundle name for which to alter targets. */ -function hook_feeds_processor_targets_alter(&$targets, $entity_type, $bundle_name) { +function hook_feeds_processor_targets_alter(&$targets, $entity_type, $bundle) { if ($entity_type == 'node') { $targets['my_node_field'] = array( 'name' => t('My custom node field'), @@ -387,7 +387,7 @@ function my_module_form_callback($mapping, $target, $form, $form_state) { * The Feed source. * @param string $entity_type * Entity type for the entity to be processed. - * @param string $bundle_name + * @param string $bundle * Bundle name for the entity to be processed. * @param string $target * A string identifying the unique target on the entity. @@ -400,12 +400,12 @@ function my_module_form_callback($mapping, $target, $form, $form_state) { * @see hook_feeds_processor_targets_alter() * @see FeedsProcessor::existingEntityId() */ -function my_module_mapper_unique(FeedsSource $source, $entity_type, $bundle_name, $target, array $values) { +function my_module_mapper_unique(FeedsSource $source, $entity_type, $bundle, $target, array $values) { list($field_name, $column) = explode(':', $target . ':value'); // Example for if the target is a field. $query = new EntityFieldQuery(); $result = $query->entityCondition('entity_type', $entity_type) - ->entityCondition('bundle', $bundle_name) + ->entityCondition('bundle', $bundle) ->fieldCondition($field_name, $column, $values) ->execute(); diff --git a/tests/feeds_tests.module b/tests/feeds_tests.module index c276d04..6c96ccf 100644 --- a/tests/feeds_tests.module +++ b/tests/feeds_tests.module @@ -104,7 +104,7 @@ function feeds_tests_files_remote() { /** * Implements hook_feeds_processor_targets_alter(). */ -function feeds_tests_feeds_processor_targets_alter(&$targets, $entity_type, $bundle_name) { +function feeds_tests_feeds_processor_targets_alter(&$targets, $entity_type, $bundle) { $targets['test_target'] = array( 'name' => t('Test Target'), 'description' => t('This is a test target.'), @@ -219,14 +219,12 @@ function feeds_tests_mapper_form($mapping, $target, $form, $form_state) { * * @see feeds_tests_feeds_processor_targets_alter() */ -function feeds_tests_mapper_unique(FeedsSource $source, $entity_type, $bundle_name, $target, array $values) { - list($field_name, $column) = explode(':', $target . ':value'); - +function feeds_tests_mapper_unique(FeedsSource $source, $entity_type, $bundle, $target, array $values) { $query = new EntityFieldQuery(); $result = $query->entityCondition('entity_type', $entity_type) - ->entityCondition('bundle', $bundle_name) - ->fieldCondition($target, $column, $values) - ->execute(); + ->entityCondition('bundle', $bundle) + ->fieldCondition('field_alpha', 'value', $values) + ->execute(); if (!empty($result[$entity_type])) { return key($result[$entity_type]);