You are here

public function Schema::tableHasXmlIndex in Drupal driver for SQL Server and SQL Azure 3.0.x

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. 8 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: Table name.

Return value

mixed Name if exists, else FALSE.

3 calls to Schema::tableHasXmlIndex()
Schema::addPrimaryKey in drivers/lib/Drupal/Driver/Database/sqlsrv/Schema.php
Add a primary key.
Schema::createIndexSql in drivers/lib/Drupal/Driver/Database/sqlsrv/Schema.php
Returns the SQL needed to create an index.
Schema::dropIndex in drivers/lib/Drupal/Driver/Database/sqlsrv/Schema.php
Drop an index.

File

drivers/lib/Drupal/Driver/Database/sqlsrv/Schema.php, line 1990

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;
}