You are here

function domain_unique_domain in Domain Access 7.2

Same name and namespace in other branches
  1. 5 domain.module \domain_unique_domain()
  2. 6.2 domain.module \domain_unique_domain()
  3. 7.3 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 1118
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);
}