function uc_addresses_example_install in Ubercart Addresses 7
Same name and namespace in other branches
- 6.2 uc_addresses_example/uc_addresses_example.install \uc_addresses_example_install()
Implements hook_install().
Installs fields defined by _uc_addresses_example_schema_fields() in tables defined by _uc_addresses_example_schema_tables().
Return value
array A list of changes in the database.
File
- uc_addresses_example/
uc_addresses_example.install, line 35 - Install file for Ubercart Addresses Example module.
Code
function uc_addresses_example_install() {
$ret = array();
$tables = _uc_addresses_example_schema_tables();
$fields = _uc_addresses_example_schema_fields();
foreach ($tables as $table) {
foreach ($fields as $fieldname => $field) {
$tablename = $table['table'];
$tablefieldname = $table['prefix'] . $fieldname;
$ret[] = db_add_field($tablename, $tablefieldname, $field);
}
}
return $ret;
}