function domain_prefix_lookup in Domain Access 6.2
Same name and namespace in other branches
- 5 domain_prefix/domain_prefix.module \domain_prefix_lookup()
Lookup stored table information for a domain.
Parameters
$domain_id: The domain_id taken from {domain}.
2 calls to domain_prefix_lookup()
- domain_prefix_form in domain_prefix/
domain_prefix.admin.inc - The table prefixing page for a domain.
- domain_prefix_form_submit in domain_prefix/
domain_prefix.admin.inc - FormsAPI for domain_prefix_form.
File
- domain_prefix/
domain_prefix.admin.inc, line 521 - Admin page functions for selective table prefixing for use with Domain Access.
Code
function domain_prefix_lookup($domain_id, $clear = FALSE) {
static $domain_prefix;
if (!empty($clear) || !isset($domain_prefix[$domain_id])) {
$domain_prefix[$domain_id] = array();
$result = db_query("SELECT domain_id, status, tablename, module, source FROM {domain_prefix} WHERE domain_id = %d", $domain_id);
while ($data = db_fetch_array($result)) {
$domain_prefix[$domain_id][$data['tablename']] = $data;
}
}
return $domain_prefix[$domain_id];
}