You are here

function globallink_is_field_configured_for_translation in GlobalLink Connect for Drupal 7.6

Same name and namespace in other branches
  1. 7.7 globallink.inc \globallink_is_field_configured_for_translation()
  2. 7.5 globallink.inc \globallink_is_field_configured_for_translation()

Determines whether or not a field is configured for translation.

Parameters

string $entity_type: The field's entity type.

string $bundle_name: The name of the bundle.

string $field_name: The field's name.

string $content_type: The field's content type.

Return value

True if the field is configured for translation.

8 calls to globallink_is_field_configured_for_translation()
globallink_beans_get_xml in globallink_beans/globallink_beans.inc
Gets XML data from specific bean.
globallink_beans_traverse_fields_and_field_collections in globallink_beans/globallink_beans.inc
Recursively adds fields and field collections to translation XML document.
globallink_entity_generate_xml_document in globallink_entity/globallink_entity.inc
Generates XML document for entity.
globallink_entity_traverse_fields_and_field_collections in globallink_entity/globallink_entity.inc
Traverses entity fields and field collections.
globallink_generate_xml_document in ./globallink_node.inc
Builds XML document with translation data.

... See full list

File

./globallink.inc, line 945
Miscellaneous GlobalLink functions for node translations (non-entity).

Code

function globallink_is_field_configured_for_translation($entity_type, $bundle_name, $field_name, $content_type) {
  $result = db_select('globallink_field_config', 'tf')
    ->fields('tf')
    ->condition('content_type', $content_type, '=')
    ->condition('entity_type', $entity_type, '=')
    ->condition('bundle', $bundle_name, '=')
    ->condition('field_name', $field_name, '=')
    ->execute();
  foreach ($result as $row) {
    if ($row->translatable == 1) {
      return TRUE;
    }
  }
  return FALSE;
}