function domain_unique_domain in Domain Access 7.3
Same name and namespace in other branches
- 5 domain.module \domain_unique_domain()
- 6.2 domain.module \domain_unique_domain()
- 7.2 domain.module \domain_unique_domain()
Validate the domain against existing domains.
Parameters
$subdomain: Domain string to check
Return value
bool TRUE if unique; FALSE if duplicate.
2 calls to domain_unique_domain()
- domain_form_validate in ./
domain.admin.inc - Implement domain_form validate hook.
- domain_validate in ./
domain.module - Validates a domain string.
File
- ./
domain.module, line 1397 - Core module functions for the Domain Access suite.
Code
function domain_unique_domain($subdomain) {
$count = db_query("SELECT COUNT(domain_id) FROM {domain} WHERE subdomain = :subdomain", array(
':subdomain' => $subdomain,
))
->fetchField();
return empty($count);
}