You are here

function ldap_query_schema in Lightweight Directory Access Protocol (LDAP) 7.2

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

Implements hook_schema().

1 call to ldap_query_schema()
ldap_servers_update_7201 in ldap_servers/ldap_servers.install
Upgrade as much as feasible for 7.1 to 7.2 branch.

File

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

Code

function ldap_query_schema() {
  $schema['ldap_query'] = [
    'export' => [
      'key' => 'qid',
      'key name' => 'Query Name',
      'identifier' => 'qid',
      'primary key' => 'query_numeric_id',
      'api' => [
        'owner' => 'ldap_query',
        'api' => 'ldap_query',
        'minimum_version' => 1,
        'current_version' => 1,
      ],
    ],
    'description' => "LDAP Query Data leveraged by other LDAP Modules",
    'primary key' => [
      'query_numeric_id',
    ],
    'foreign keys' => [
      'sid' => [
        'table' => 'ldap_servers',
        'columns' => [
          'sid' => 'sid',
        ],
      ],
    ],
  ];
  module_load_include('module', 'ldap_servers');
  ldap_servers_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;
}