You are here

function globallink_check_field_configured in GlobalLink Connect for Drupal 7.5

Same name and namespace in other branches
  1. 7.7 globallink.module \globallink_check_field_configured()
  2. 7.6 globallink.module \globallink_check_field_configured()

Checks if a field is configured.

Parameters

string $content_type: The field's content type.

string $entity_type: The field's entity type.

bool $bundle: The field bundle name.

string $field_name: The name of the field.

Return value

bool True if the field is configured, and false if it isn't.

2 calls to globallink_check_field_configured()
globallink_form_entity_translation_translatable_form_submit in ./globallink.module
globallink_form_field_ui_field_edit_form_submit in ./globallink.module
Update field config for modified bundle field.

File

./globallink.module, line 1139
GlobalLink translation module.

Code

function globallink_check_field_configured($content_type, $entity_type, $bundle, $field_name) {
  $result = db_select('globallink_field_config', 'tfc')
    ->fields('tfc')
    ->condition('content_type', $content_type, '=')
    ->condition('entity_type', $entity_type, '=')
    ->condition('bundle', $bundle, '=')
    ->condition('field_name', $field_name, '=')
    ->execute();
  foreach ($result as $row) {
    return TRUE;
  }
  return FALSE;
}