Index
class Index (View source)
Index manipulation class
Constants
PRIMARY |
|
UNIQUE |
|
INDEX |
|
SPATIAL |
|
FULLTEXT |
|
Methods
No description
Creates (if not already created) and returns the corresponding Index object
returns an array with all indexes from the given table
Returns an array with all indexes from the given table of the requested types
Add column to index
Adds a list of columns to the index
Returns true if $column indexed in this index
Sets index details
Returns the number of columns of the index
Returns the index comment
Returns index remarks
Return the key block size
Return the parser
Returns concatenated remarks and comment
Returns index type (BTREE, HASH, RTREE)
Returns index choice (PRIMARY, UNIQUE, INDEX, SPATIAL, FULLTEXT)
Returns a lit of all index types
No description
Returns how the index is packed
Returns 'No' if the index is not packed, how the index is packed if packed
Returns bool false if the index cannot contain duplicates, true if it can
Returns whether the index is a 'Unique' index
Returns the name of the index
Sets the name of the index
Returns the columns of the index
Gets the properties in an array for comparison purposes
Function to check over array of indexes and look for common problems
Details
__construct(array $params = [])
No description
static Index
singleton(DatabaseInterface $dbi, string $schema, string $table, string $indexName = '')
Creates (if not already created) and returns the corresponding Index object
static array
getFromTable(DatabaseInterface $dbi, string $table, string $schema)
returns an array with all indexes from the given table
static array
getFromTableByChoice(string $table, string $schema, int $choices = 31)
Returns an array with all indexes from the given table of the requested types
static Index|null
getPrimary(DatabaseInterface $dbi, string $table, string $schema)
No description
void
addColumn(array $params)
Add column to index
void
addColumns(array $columns)
Adds a list of columns to the index
bool
hasColumn(string $column)
Returns true if $column indexed in this index
void
set(array $params)
Sets index details
int
getColumnCount()
Returns the number of columns of the index
string
getComment()
Returns the index comment
string
getRemarks()
Returns index remarks
int
getKeyBlockSize()
Return the key block size
string
getParser()
Return the parser
string
getComments()
Returns concatenated remarks and comment
string
getType()
Returns index type (BTREE, HASH, RTREE)
string
getChoice()
Returns index choice (PRIMARY, UNIQUE, INDEX, SPATIAL, FULLTEXT)
static array
getIndexTypes()
Returns a lit of all index types
bool
hasPrimary()
No description
string|null
getPacked()
Returns how the index is packed
string
isPacked()
Returns 'No' if the index is not packed, how the index is packed if packed
bool
getNonUnique()
Returns bool false if the index cannot contain duplicates, true if it can
string|bool
isUnique(bool $asText = false)
Returns whether the index is a 'Unique' index
string
getName()
Returns the name of the index
void
setName(string $name)
Sets the name of the index
array
getColumns()
Returns the columns of the index
array
getCompareData()
Gets the properties in an array for comparison purposes
static string
findDuplicates(string $table, string $schema)
Function to check over array of indexes and look for common problems