You are here

function _relation_endpoint_get_endpoint_entity_types in Relation 7

Helper getting endpoint entity types for the bundle specified in $instance.

2 calls to _relation_endpoint_get_endpoint_entity_types()
relation_endpoint_field_formatter_settings_form in ./relation_endpoint.module
Implements hook_field_formatter_settings_form().
relation_endpoint_field_formatter_settings_summary in ./relation_endpoint.module
Implements hook_field_formatter_settings_summary().

File

./relation_endpoint.module, line 246
Relation endpoints field.

Code

function _relation_endpoint_get_endpoint_entity_types($instance) {
  $relation_type = relation_type_load($instance['bundle']);
  $bundles = $relation_type->source_bundles + $relation_type->target_bundles;
  foreach ($bundles as $bundle_key) {
    list($endpoint_entity_type) = explode(':', $bundle_key);
    $endpoint_entity_types[$endpoint_entity_type] = TRUE;
  }
  return $endpoint_entity_types;
}