drupal_get_schema_unprocessed

  1. drupal
    1. drupal6
    2. drupal7
Versionen
drupal6 – drupal7 drupal_get_schema_unprocessed($module, $table = NULL)

Returns the unprocessed and unaltered version of a module's schema.

Use this function only if you explicitly need the original specification of a schema, as it was defined in a module's hook_schema(). No additional default values will be set, hook_schema_alter() is not invoked and these unprocessed definitions won't be cached.

This function can be used to retrieve a schema specification in hook_schema(), so it allows you to derive your tables from existing specifications.

It is also used by drupal_install_schema() and drupal_uninstall_schema() to ensure that a module's tables are created exactly as specified without any changes introduced by a module that implements hook_schema_alter().

Übergabeparameter

$module The module to which the table belongs.

$table The name of the table. If not given, the module's complete schema is returned.

Verwandte Themen

▾ 8 functions call drupal_get_schema_unprocessed()

block_schema in modules/block/block.install
Implementation of hook_schema().
drupal_install_schema in includes/common.inc
Create all tables that a module defines in its hook_schema().
drupal_uninstall_schema in includes/common.inc
Remove all tables that a module defines in its hook_schema().
field_schema in modules/field/field.install
Implementation of hook_schema.
filter_schema in modules/filter/filter.install
Implementation of hook_schema().
simpletest_clean_database in modules/simpletest/simpletest.module
Removed prefixed tables from the database that are left over from crashed tests.
update_fix_d7_requirements in ./update.php
Perform Drupal 6.x to 7.x updates that are required for update.php to function properly.
update_schema in modules/update/update.install
Implementation of hook_schema().

Code

includes/common.inc, line 4106

<?php
function drupal_get_schema_unprocessed($module, $table = NULL) {
  // Load the .install file to get hook_schema.
  module_load_install($module);
  $schema = module_invoke($module, 'schema');

  if (!is_null($table) && isset($schema[$table])) {
    return $schema[$table];
  }
  else {
    return $schema;
  }
}
?>

Kommentare

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen