You are here

function data_search_get_tables in Data 8

Same name and namespace in other branches
  1. 6 data_search/data_search.module \data_search_get_tables()
  2. 7 data_search/data_search.module \data_search_get_tables()

Gather all tables which might be eligible for searching.

4 calls to data_search_get_tables()
data_search_cron in data_search/data_search.module
Implements hook_cron().
data_search_search in data_search/data_search.module
Implements hook_search().
data_search_update_index in data_search/data_search.module
Implements hook_update_index().
data_search_views_data_alter in data_search/data_search.module
Implements hook_views_data_alter().

File

data_search/data_search.module, line 174

Code

function data_search_get_tables() {
  $tables = array();
  foreach (data_get_all_tables() as $table) {
    $schema = $table
      ->get('table_schema');
    $fields = data_search_get_fields($table);
    if (isset($schema['primary key']) && count($schema['primary key']) >= 1 && !empty($fields)) {
      $tables[] = $table;
    }
  }
  return $tables;
}