function hook_domainupdate in Domain Access 5
Same name and namespace in other branches
- 6.2 API.php \hook_domainupdate()
- 7.2 domain.api.php \hook_domainupdate()
Notify other modules that we have created a new domain or updated a domain record.
For 'update' and 'delete' operations, the $domain array holds the original values of the domain record. The $edit array will hold the new, replacement values. This is useful when making changes to records, such as in domain_user_domainupdate().
Parameters
$op: The operation being performed: 'create', 'update', 'delete'
$edit: The form values processed by the form.
Related topics
6 functions implement hook_domainupdate()
Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.
- domain_conf_domainupdate in domain_conf/
domain_conf.module - Implement hook_domainupdate().
- domain_domainupdate in ./
domain.module - Implement hook_domainupdate()
- domain_nav_domainupdate in domain_nav/
domain_nav.module - Implement hook_domainupdate()
- domain_prefix_domainupdate in domain_prefix/
domain_prefix.module - Implement hook_domainupdate().
- domain_source_domainupdate in domain_source/
domain_source.module - Implement hook_domainupdate()
4 invocations of hook_domainupdate()
- domain_create_form_submit in ./
domain_admin.inc - FormsAPI for domain_create_form()
- domain_delete_form_submit in ./
domain_admin.inc - FormsAPI for domain_delete_form()
- domain_edit_form_submit in ./
domain_admin.inc - FormsAPI for domain_edit_form()
- domain_user_user in domain_user/
domain_user.module - Implement hook_user()
File
- ./
API.php, line 123 - API documentation file.
Code
function hook_domainupdate($op, $domain = array(), $edit = array()) {
switch ($op) {
case 'create':
db_query("INSERT INTO {mytable} (subdomain, sitename) VALUES ('%s', '%s')", $domain['subdomain'], $domain['sitename']);
break;
case 'update':
db_query("UPDATE {mytable} SET subdomain = '%s', sitename = '%s' WHERE domain_id = %d", $domain['subdomain'], $domain['sitename'], $domain['domain_id']);
break;
case 'delete':
db_query("DELETE FROM {mytable} WHERE subdomain = '%s'", $domain['subdomain']);
break;
}
}