You are here

function synonyms_field_target_bundles in Synonyms 7

Determine a list of target bundles of an entityreference field.

Parameters

array $field: Field definition array. This field must be of type 'entityreference'

Return value

array|null List of target bundles per the settings of provided field or NULL if the provided field does not expose any limitations on target bundles

3 calls to synonyms_field_target_bundles()
synonyms_autocomplete_entity in ./synonyms.pages.inc
Page callback: Outputs JSON for entity autocomplete suggestions.
synonyms_autocomplete_entity_validate in ./synonyms.module
Form element validate handler.
synonyms_views_handler_filter_entityreference_synonyms::query in views/synonyms_views_handler_filter_entityreference_synonyms.inc
Add this filter to the query.

File

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

Code

function synonyms_field_target_bundles($field) {
  $target_bundles = isset($field['settings']['handler_settings']['target_bundles']) ? array_values($field['settings']['handler_settings']['target_bundles']) : array();
  if (empty($target_bundles)) {
    $target_bundles = NULL;
  }
  return $target_bundles;
}