PHP Class PMA\libraries\Index

Afficher le fichier Open project: phpmyadmin/phpmyadmin Class Usage Examples

Méthodes publiques

Méthode Description
__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

Private Methods

Méthode Description
_loadIndexes ( string $table, string $schema ) : boolean Load index data for table

Method Details

__construct() public méthode

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

addColumn() public méthode

Add column to index
public addColumn ( array $params ) : void
$params array column params
Résultat void

addColumns() public méthode

Adds a list of columns to the index
public addColumns ( array $columns ) : void
$columns array array containing details about the columns
Résultat void

findDuplicates() public static méthode

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
Résultat string Output HTML

generateIndexChoiceSelector() public méthode

Returns HTML for the index choice selector
public generateIndexChoiceSelector ( boolean $edit_table ) : string
$edit_table boolean whether this is table editing
Résultat string HTML for the index choice selector

generateIndexTypeSelector() public méthode

Returns HTML for the index type selector
public generateIndexTypeSelector ( ) : string
Résultat string HTML for the index type selector

getChoice() public méthode

Returns index choice (PRIMARY, UNIQUE, INDEX, SPATIAL, FULLTEXT)
public getChoice ( ) : string
Résultat string index choice

getColumnCount() public méthode

Returns the number of columns of the index
public getColumnCount ( ) : integer
Résultat integer the number of the columns

getColumns() public méthode

Returns the columns of the index
public getColumns ( ) : PMA\libraries\IndexColumn[]
Résultat PMA\libraries\IndexColumn[] the columns of the index

getComment() public méthode

Returns the index comment
public getComment ( ) : string
Résultat string index comment

getComments() public méthode

Returns concatenated remarks and comment
public getComments ( ) : string
Résultat string concatenated remarks and comment

getCompareData() public méthode

Gets the properties in an array for comparison purposes
public getCompareData ( ) : array
Résultat array an array containing the properties of the index

getFromTable() public static méthode

returns an array with all indexes from the given table
public static getFromTable ( string $table, string $schema ) : Index[]
$table string table
$schema string schema
Résultat Index[] array of indexes

getFromTableByChoice() public static méthode

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
Résultat Index[] array of indexes

getHtmlForIndexes() public static méthode

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
Résultat string HTML for showing index

getIndexChoices() public static méthode

Return a list of all index choices
public static getIndexChoices ( ) : string[]
Résultat string[] index choices

getIndexTypes() public static méthode

Returns a lit of all index types
public static getIndexTypes ( ) : string[]
Résultat string[] index types

getKeyBlockSize() public méthode

Return the key block size
public getKeyBlockSize ( ) : number
Résultat number

getName() public méthode

Returns the name of the index
public getName ( ) : string
Résultat string the name of the index

getNonUnique() public méthode

Returns integer 0 if the index cannot contain duplicates, 1 if it can
public getNonUnique ( ) : integer
Résultat integer 0 if the index cannot contain duplicates, 1 if it can

getPacked() public méthode

Returns how the index is packed
public getPacked ( ) : string
Résultat string how the index is packed

getParser() public méthode

Return the parser
public getParser ( ) : string
Résultat string

getPrimary() public static méthode

return primary if set, false otherwise
public static getPrimary ( string $table, string $schema ) : mixed
$table string table
$schema string schema
Résultat mixed primary index or false if no one exists

getRemarks() public méthode

Returns index remarks
public getRemarks ( ) : string
Résultat string index remarks

getType() public méthode

Returns index type (BTREE, HASH, RTREE)
public getType ( ) : string
Résultat string index type

hasColumn() public méthode

Returns true if $column indexed in this index
public hasColumn ( string $column ) : boolean
$column string the column
Résultat boolean true if $column indexed in this index

isPacked() public méthode

Returns 'No' if the index is not packed, how the index is packed if packed
public isPacked ( ) : string
Résultat string

isUnique() public méthode

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
Résultat mixed whether the index is a 'Unique' index

set() public méthode

Sets index details
public set ( array $params ) : void
$params array index details
Résultat void

setName() public méthode

Sets the name of the index
public setName ( string $name ) : void
$name string index name
Résultat void

singleton() public static méthode

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
Résultat Index corresponding Index object