class Index in Drupal driver for SQL Server and SQL Azure 8
Same name and namespace in other branches
- 8.2 src/Indexes/Index.php \Drupal\sqlsrv\Indexes\Index
Represents a database Index.
Hierarchy
- class \Drupal\sqlsrv\Indexes\Index
Expanded class hierarchy of Index
File
- src/
Indexes/ Index.php, line 8
Namespace
Drupal\sqlsrv\IndexesView source
class Index {
private $table;
private $name;
private $code;
/**
* Create an instance of Index.
*
* @param mixed $uri
* @throws \Exception
*/
public function __construct($uri) {
$name = pathinfo($uri, PATHINFO_FILENAME);
$parts = explode('@', basename($name));
if (count($parts) != 2) {
throw new \Exception('Incorrect SQL index file name format.');
}
$this->table = $parts[0];
$this->name = $parts[1];
$this->code = file_get_contents($uri);
}
/**
* Table name.
*
* @return string
*/
public function GetTable() {
return $this->table;
}
/**
* Index name.
*
* @return string
*/
public function GetName() {
return $this->name;
}
/**
* Get the SQL statement to create this index.
*
* @return string
*/
public function GetCode() {
return $this->code;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Index:: |
private | property | ||
Index:: |
private | property | ||
Index:: |
private | property | ||
Index:: |
public | function | Get the SQL statement to create this index. | |
Index:: |
public | function | Index name. | |
Index:: |
public | function | Table name. | |
Index:: |
public | function | Create an instance of Index. |