function domain_save in Domain Access 6.2
Same name and namespace in other branches
- 7.3 domain.module \domain_save()
- 7.2 domain.module \domain_save()
Domain save function.
Parameters
$values: Form value information.
$edit: Form state information.
Return value
$domain array on success or -1 on failure.
1 call to domain_save()
- domain_form_submit in ./
domain.admin.inc - Implement domain_form submit hook.
File
- ./
domain.module, line 793 - Core module functions for the Domain Access suite.
Code
function domain_save($values, $edit) {
// Update or insert a record?
$update = isset($values['domain_id']) && is_numeric($values['domain_id']) ? array(
'domain_id',
) : array();
if (!empty($update)) {
$action = 'update';
}
else {
$action = 'create';
}
drupal_write_record('domain', $values, $update);
// Let other modules act.
$domain = domain_lookup(NULL, $values['subdomain']);
module_invoke_all('domainupdate', $action, $domain, $edit);
// Return the recorded domain.
return $domain;
}