_drupal_initialize_schema

Versions
6
_drupal_initialize_schema($module, &$schema)

Fill in required default values for table definitions returned by hook_schema().

Parameters

$module The module for which hook_schema() was invoked.

$schema The schema definition array as it was returned by the module's hook_schema().

Related topics

▾ 3 functions call _drupal_initialize_schema()

drupal_get_schema in includes/common.inc
Get the schema definition of a table, or the whole database 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().

Code

includes/common.inc, line 3325

<?php
function _drupal_initialize_schema($module, &$schema) {
  // Set the name and module key for all tables.
  foreach ($schema as $name => $table) {
    if (empty($table['module'])) {
      $schema[$name]['module'] = $module;
    }
    if (!isset($table['name'])) {
      $schema[$name]['name'] = $name;
    }
  }
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.