You are here

function synonyms_bundle_normalize in Synonyms 7

Normalize bundle argument.

Parameters

string $entity_type: Entity type to define scope of bundles

string|array $bundle: Either a single bundle name or an array of bundle names. Empty array implies all known bundles for $entity_type

Return value

array Normalized array bundle names

6 calls to synonyms_bundle_normalize()
synonyms_behavior_get in ./synonyms.module
Load function for existing implementations of synonyms behaviors.
synonyms_behavior_get_all_enabled in ./synonyms.module
Load all enabled behavior implementations on an entity_type and a bundle.
synonyms_commerce_autocomplete in synonyms_commerce/synonyms_commerce.pages.inc
Menu page callback for synonyms commerce autocomplete widget.
synonyms_commerce_autocomplete_validate in synonyms_commerce/synonyms_commerce.module
Element validate for commerce product synonyms friendly autocomplete widget.
synonyms_entity_type_load in ./synonyms.module
Test if entity type is applicable for having synonyms.

... See full list

File

./synonyms.module, line 1558
Provide synonyms feature for Drupal entities.

Code

function synonyms_bundle_normalize($entity_type, $bundle) {
  $bundle = (array) $bundle;
  if (empty($bundle)) {
    $bundle = array_keys(field_info_bundles($entity_type));
  }
  return $bundle;
}