Sunday, September 2, 2012

hook_schema

A Drupal schema definition is an array structure representing one or more tables and their related keys and indexes. A schema is defined by hook_schema() which must live in your module's .install file.
By implementing hook_schema() and specifying the tables your module declares, you can easily create and drop these tables on all supported database engines. You don't have to deal with the different SQL dialects for table creation and alteration of the supported database engines.
See the Schema API documentation at http://drupal.org/node/146843 for details on hook_schema(), where database tables are defined.

Return value

A schema definition structure array. For each element of the array, the key is a table name and the value is a table structure definition.

Read More..

No comments:

Post a Comment

only show translated menu items into current language (Drupal 8)

function MY_THEME_preprocess_menu(&$variables) {   if ($variables['menu_name'] == 'brancott-header-menu') {    $langu...