You are here

public function Schema::tableHasXmlIndex in Drupal driver for SQL Server and SQL Azure 8

Same name and namespace in other branches
  1. 8.2 drivers/lib/Drupal/Driver/Database/sqlsrv/Schema.php \Drupal\Driver\Database\sqlsrv\Schema::tableHasXmlIndex()
  2. 3.0.x drivers/lib/Drupal/Driver/Database/sqlsrv/Schema.php \Drupal\Driver\Database\sqlsrv\Schema::tableHasXmlIndex()

Check if a table already has an XML index.

Parameters

string $table:

string $name:

3 calls to Schema::tableHasXmlIndex()
Schema::addPrimaryKey in drivers/lib/Drupal/Driver/Database/sqlsrv/Schema.php
Override DatabaseSchema::addPrimaryKey().
Schema::createIndexSql in drivers/lib/Drupal/Driver/Database/sqlsrv/Schema.php
Returns the SQL needed (incomplete) to create and index. Supports XML indexes.
Schema::dropIndex in drivers/lib/Drupal/Driver/Database/sqlsrv/Schema.php
Override DatabaseSchema::dropIndex().

File

drivers/lib/Drupal/Driver/Database/sqlsrv/Schema.php, line 1662
Definition of Drupal\Driver\Database\sqlsrv\Schema

Class

Schema

Namespace

Drupal\Driver\Database\sqlsrv

Code

public function tableHasXmlIndex($table) {
  $info = $this
    ->queryColumnInformation($table);
  if (isset($info['indexes']) && is_array($info['indexes'])) {
    foreach ($info['indexes'] as $name => $index) {
      if (strcasecmp($index['type_desc'], 'XML') == 0) {
        return $name;
      }
    }
  }
  return FALSE;
}