function globallink_get_parent_bundle_name in GlobalLink Connect for Drupal 7.7
Same name and namespace in other branches
- 7.5 globallink.inc \globallink_get_parent_bundle_name()
- 7.6 globallink.inc \globallink_get_parent_bundle_name()
Gets parent bundle name of field.
Parameters
string $entity_type: The field's entity type.
string $content_type: The field's content type.
string $field_name: The field's name.
Return value
string The parent bundle name.
File
- ./
globallink.inc, line 856 - Miscellaneous GlobalLink functions for node translations (non-entity).
Code
function globallink_get_parent_bundle_name($entity_type, $content_type, $field_name) {
$bundle = '';
$result = db_select('globallink_field_config', 'tf')
->fields('tf')
->condition('content_type', $content_type, '=')
->condition('entity_type', $entity_type, '=')
->condition('field_name', $field_name, '=')
->execute();
foreach ($result as $row) {
$bundle = $row->bundle;
}
return $bundle;
}