PHP Класс PMA\libraries\Index

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( array $params = [] ) Constructor
addColumn ( array $params ) : void Add column to index
addColumns ( array $columns ) : void Adds a list of columns to the index
findDuplicates ( string $table, string $schema ) : string Function to check over array of indexes and look for common problems
generateIndexChoiceSelector ( boolean $edit_table ) : string Returns HTML for the index choice selector
generateIndexTypeSelector ( ) : string Returns HTML for the index type selector
getChoice ( ) : string Returns index choice (PRIMARY, UNIQUE, INDEX, SPATIAL, FULLTEXT)
getColumnCount ( ) : integer Returns the number of columns of the index
getColumns ( ) : PMA\libraries\IndexColumn[] Returns the columns of the index
getComment ( ) : string Returns the index comment
getComments ( ) : string Returns concatenated remarks and comment
getCompareData ( ) : array Gets the properties in an array for comparison purposes
getFromTable ( string $table, string $schema ) : Index[] returns an array with all indexes from the given table
getFromTableByChoice ( string $table, string $schema, integer $choices = 31 ) : Index[] Returns an array with all indexes from the given table of the requested types
getHtmlForIndexes ( string $table, string $schema, boolean $print_mode = false ) : string Show index data
getIndexChoices ( ) : string[] Return a list of all index choices
getIndexTypes ( ) : string[] Returns a lit of all index types
getKeyBlockSize ( ) : number Return the key block size
getName ( ) : string Returns the name of the index
getNonUnique ( ) : integer Returns integer 0 if the index cannot contain duplicates, 1 if it can
getPacked ( ) : string Returns how the index is packed
getParser ( ) : string Return the parser
getPrimary ( string $table, string $schema ) : mixed return primary if set, false otherwise
getRemarks ( ) : string Returns index remarks
getType ( ) : string Returns index type (BTREE, HASH, RTREE)
hasColumn ( string $column ) : boolean Returns true if $column indexed in this index
isPacked ( ) : string Returns 'No' if the index is not packed, how the index is packed if packed
isUnique ( boolean $as_text = false ) : mixed Returns whether the index is a 'Unique' index
set ( array $params ) : void Sets index details
setName ( string $name ) : void Sets the name of the index
singleton ( string $schema, string $table, string $index_name = '' ) : Index Creates(if not already created) and returns the corresponding Index object

Приватные методы

Метод Описание
_loadIndexes ( string $table, string $schema ) : boolean Load index data for table

Описание методов

__construct() публичный Метод

Constructor
public __construct ( array $params = [] )
$params array parameters

addColumn() публичный Метод

Add column to index
public addColumn ( array $params ) : void
$params array column params
Результат void

addColumns() публичный Метод

Adds a list of columns to the index
public addColumns ( array $columns ) : void
$columns array array containing details about the columns
Результат void

findDuplicates() публичный статический Метод

Function to check over array of indexes and look for common problems
public static findDuplicates ( string $table, string $schema ) : string
$table string table name
$schema string schema name
Результат string Output HTML

generateIndexChoiceSelector() публичный Метод

Returns HTML for the index choice selector
public generateIndexChoiceSelector ( boolean $edit_table ) : string
$edit_table boolean whether this is table editing
Результат string HTML for the index choice selector

generateIndexTypeSelector() публичный Метод

Returns HTML for the index type selector
public generateIndexTypeSelector ( ) : string
Результат string HTML for the index type selector

getChoice() публичный Метод

Returns index choice (PRIMARY, UNIQUE, INDEX, SPATIAL, FULLTEXT)
public getChoice ( ) : string
Результат string index choice

getColumnCount() публичный Метод

Returns the number of columns of the index
public getColumnCount ( ) : integer
Результат integer the number of the columns

getColumns() публичный Метод

Returns the columns of the index
public getColumns ( ) : PMA\libraries\IndexColumn[]
Результат PMA\libraries\IndexColumn[] the columns of the index

getComment() публичный Метод

Returns the index comment
public getComment ( ) : string
Результат string index comment

getComments() публичный Метод

Returns concatenated remarks and comment
public getComments ( ) : string
Результат string concatenated remarks and comment

getCompareData() публичный Метод

Gets the properties in an array for comparison purposes
public getCompareData ( ) : array
Результат array an array containing the properties of the index

getFromTable() публичный статический Метод

returns an array with all indexes from the given table
public static getFromTable ( string $table, string $schema ) : Index[]
$table string table
$schema string schema
Результат Index[] array of indexes

getFromTableByChoice() публичный статический Метод

Returns an array with all indexes from the given table of the requested types
public static getFromTableByChoice ( string $table, string $schema, integer $choices = 31 ) : Index[]
$table string table
$schema string schema
$choices integer choices
Результат Index[] array of indexes

getHtmlForIndexes() публичный статический Метод

Show index data
public static getHtmlForIndexes ( string $table, string $schema, boolean $print_mode = false ) : string
$table string The table name
$schema string The schema name
$print_mode boolean Whether the output is for the print mode
Результат string HTML for showing index

getIndexChoices() публичный статический Метод

Return a list of all index choices
public static getIndexChoices ( ) : string[]
Результат string[] index choices

getIndexTypes() публичный статический Метод

Returns a lit of all index types
public static getIndexTypes ( ) : string[]
Результат string[] index types

getKeyBlockSize() публичный Метод

Return the key block size
public getKeyBlockSize ( ) : number
Результат number

getName() публичный Метод

Returns the name of the index
public getName ( ) : string
Результат string the name of the index

getNonUnique() публичный Метод

Returns integer 0 if the index cannot contain duplicates, 1 if it can
public getNonUnique ( ) : integer
Результат integer 0 if the index cannot contain duplicates, 1 if it can

getPacked() публичный Метод

Returns how the index is packed
public getPacked ( ) : string
Результат string how the index is packed

getParser() публичный Метод

Return the parser
public getParser ( ) : string
Результат string

getPrimary() публичный статический Метод

return primary if set, false otherwise
public static getPrimary ( string $table, string $schema ) : mixed
$table string table
$schema string schema
Результат mixed primary index or false if no one exists

getRemarks() публичный Метод

Returns index remarks
public getRemarks ( ) : string
Результат string index remarks

getType() публичный Метод

Returns index type (BTREE, HASH, RTREE)
public getType ( ) : string
Результат string index type

hasColumn() публичный Метод

Returns true if $column indexed in this index
public hasColumn ( string $column ) : boolean
$column string the column
Результат boolean true if $column indexed in this index

isPacked() публичный Метод

Returns 'No' if the index is not packed, how the index is packed if packed
public isPacked ( ) : string
Результат string

isUnique() публичный Метод

Returns whether the index is a 'Unique' index
public isUnique ( boolean $as_text = false ) : mixed
$as_text boolean whether to output should be in text
Результат mixed whether the index is a 'Unique' index

set() публичный Метод

Sets index details
public set ( array $params ) : void
$params array index details
Результат void

setName() публичный Метод

Sets the name of the index
public setName ( string $name ) : void
$name string index name
Результат void

singleton() публичный статический Метод

Creates(if not already created) and returns the corresponding Index object
public static singleton ( string $schema, string $table, string $index_name = '' ) : Index
$schema string database name
$table string table name
$index_name string index name
Результат Index corresponding Index object