You are here

function hook_commerce_bpc_is_combination_field in Commerce Bulk Product Creation 7

Same name and namespace in other branches
  1. 7.2 commerce_bpc.api.php \hook_commerce_bpc_is_combination_field()

Specify whether a field instance is used to create combinations.

This hook is invoked to determine whether some other hooks should be run on instance (e.g. the token hooks) and to determine whether a product type is fit for bulk product creation (it needs to have at least one combination-creating instance).

Parameters

array $instance: Array holding instance information.

Return value

bool TRUE if the implementing module manages combination creation through the instance.

2 functions implement hook_commerce_bpc_is_combination_field()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

bpc_taxonomy_commerce_bpc_is_combination_field in modules/bpc_taxonomy/bpc_taxonomy.module
Implements hook_commerce_bpc_is_combination_field().
commerce_bpc_commerce_bpc_is_combination_field in ./commerce_bpc.hooks_list.inc
Implements hook_commerce_bpc_is_combination_field().
1 invocation of hook_commerce_bpc_is_combination_field()
commerce_bpc_is_combination_field in ./commerce_bpc.module
Determine whether a field instance is suitable for combination-generation.

File

./commerce_bpc.api.php, line 25
This file contains no working PHP code; it exists to provide additional documentation for doxygen as well as to document hooks in the standard Drupal manner.

Code

function hook_commerce_bpc_is_combination_field($instance) {
  $field = field_info_field($instance['field_name']);
  if ($field['module'] == 'list') {
    return !_commerce_bpc_get_value($instance, array(
      'commerce_bpc',
      'is_static',
    ), FALSE);
  }
}