You are here

function globallink_get_all_content_types_for_field in GlobalLink Connect for Drupal 7.7

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

Gets all content types for a specified field.

Parameters

string $field_name: The name of the field to search.

string $type: The field's type.

Return value

array An array containing all content types for the specified field.

5 calls to globallink_get_all_content_types_for_field()
globallink_form_entity_translation_translatable_form_submit in ./globallink.module
Submit function to synch up the content type field config changes with the globallink field config changes.
globallink_form_field_ui_field_delete_form_submit in ./globallink.module
Submit handler for delete link on Manage Fields Page of Content Type and Field Collection. This deletes a field from fields config table.
globallink_form_field_ui_field_edit_form_submit in ./globallink.module
Update field config for modified bundle field.
globallink_form_field_ui_field_overview_form_submit in ./globallink.module
Submit handler for Manage Fields Page of Content Type and Field Collection. Adds a new field being added to the fields config table for translation.
globallink_get_allparent_fc in ./globallink.module

File

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

Code

function globallink_get_all_content_types_for_field($field_name, $type) {
  $array = array();
  $result = db_select('globallink_field_config', 'tf')
    ->fields('tf', array(
    'content_type',
  ))
    ->distinct()
    ->condition('field_name', $field_name, '=')
    ->condition('field_type', $type, '=')
    ->execute();
  foreach ($result as $row) {
    $array[] = $row->content_type;
  }
  return $array;
}