You are here

function ldap_query_schema in Lightweight Directory Access Protocol (LDAP) 7

Same name and namespace in other branches
  1. 8.2 ldap_query/ldap_query.install \ldap_query_schema()
  2. 7.2 ldap_query/ldap_query.install \ldap_query_schema()

Implements hook_schema().

File

ldap_query/ldap_query.install, line 31
Install, update and uninstall functions for the LDAP API module.

Code

function ldap_query_schema() {
  $schema['ldap_query'] = array(
    'export' => array(
      'key' => 'qid',
      'key name' => 'Query Name',
      'identifier' => 'qid',
      'primary key' => 'query_numeric_id',
      'api' => array(
        'owner' => 'ldap_query',
        'api' => 'ldap_query',
        'minimum_version' => 1,
        'current_version' => 1,
      ),
    ),
    'description' => "LDAP Query Data leveraged by other LDAP Modules",
    'primary key' => array(
      'query_numeric_id',
    ),
    'foreign keys' => array(
      'sid' => array(
        'table' => 'ldap_servers',
        'columns' => array(
          'sid' => 'sid',
        ),
      ),
    ),
  );
  module_load_include('inc', 'ldap_servers', 'ldap_servers.functions');
  ldap_server_module_load_include('php', 'ldap_query', 'LdapQuery.class');
  $fields = LdapQuery::fields();
  foreach ($fields as $field_id => $field) {
    if (isset($field['schema'])) {
      $schema['ldap_query']['fields'][$field_id] = $field['schema'];
    }
  }
  return $schema;
}