You are here

function domain_prefix_get_tables in Domain Access 6.2

Same name and namespace in other branches
  1. 5 domain_prefix/domain_prefix.module \domain_prefix_get_tables()

Get the tables with the active prefix

Parameters

$prefix: The table prefix used with this domain. Optional.

2 calls to domain_prefix_get_tables()
domain_prefix_configure_form in domain_prefix/domain_prefix.admin.inc
FormsAPI for generating the configuration form
domain_prefix_form in domain_prefix/domain_prefix.admin.inc
The table prefixing page for a domain.

File

domain_prefix/domain_prefix.admin.inc, line 16
Admin page functions for selective table prefixing for use with Domain Access.

Code

function domain_prefix_get_tables($prefix = NULL) {

  // Check for default prefix settings.
  if (empty($prefix)) {
    $prefix = domain_prefix_get_prefix();
  }

  // Get the database schema information.
  $schema = drupal_get_schema();
  ksort($schema);
  $tables = array();
  $disallow = domain_prefix_disallow();
  foreach ($schema as $table => $data) {
    if (!in_array($table, $disallow)) {
      $tables[$table]['tablename'] = $table;
      $tables[$table]['module'] = $data['module'];
    }
  }

  // Sort them by module
  uasort($tables, '_domain_prefix_sort');
  return $tables;
}