You are here

function synonyms_bundle_load in Synonyms 7

Test if provided entity type and bundle are applicable for having synonyms.

Parameters

string $bundle: Bundle name to test for ability to have synonyms

string $entity_type: Entity type to test for ability to have synonyms

Return value

bool|string Whether the provided entity type and bundle may have synonyms. If they do, the $bundle input argument is returned. Otherwise FALSE is returned

File

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

Code

function synonyms_bundle_load($bundle, $entity_type) {
  foreach (synonyms_behaviors() as $behavior => $behavior_definition) {
    $behavior_implementations = synonyms_behavior_implementation_info($entity_type, $bundle, $behavior);
    if (!empty($behavior_implementations)) {
      return $bundle;
    }
  }
  return FALSE;
}