class CentralColumns

PhpMyAdmin\CentralColumns class

Properties

Template $template

Methods

__construct(DatabaseInterface $dbi)

Constructor

array|bool
getParams()

Defines the central_columns parameters for the current user

array
getColumnsList(string $db, int $from = 0, int $num = 25)

get $num columns of given database from central columns list starting at offset $from

int
getCount(string $db)

Get the number of columns present in central list for given db

true|Message
syncUniqueColumns(array $field_select, bool $isTable = true, string|null $table = null)

If $isTable is true then unique columns from given tables as $field_select are added to central list otherwise the $field_select is considered as list of columns and these columns are added to central list if not already added

true|Message
deleteColumnsFromList(string $database, array $field_select, bool $isTable = true)

if $isTable is true it removes all columns of given tables as $field_select from central columns list otherwise $field_select is columns list and it removes given columns if present in central list

true|Message
makeConsistentWithList(string $db, array $selected_tables)

Make the columns of given tables consistent with central list of columns.

array
getFromTable(string $db, string $table, bool $allFields = false)

return the columns present in central list of columns for a given table of a given database

true|Message
updateOneColumn(string $db, string $orig_col_name, string $col_name, string $col_type, string $col_attribute, string $col_length, int $col_isNull, string $collation, string $col_extra, string $col_default)

update a column in central columns list if a edit is requested

true|Message
updateMultipleColumn(array $params)

Update Multiple column in central columns list if a change is requested

array
getListRaw(string $db, string $table)

get the list of columns in given database excluding the columns present in current table

string
getTableFooter(string $pmaThemeImage, string $text_dir)

Get HTML for "check all" check box with "with selected" dropdown

string
getHtmlForEditingPage(array $selected_fld, string $selected_db)

Get HTML for editing page central columns

int
getColumnsCount(string $db, int $from = 0, int $num = 25)

get number of columns of given database from central columns list starting at offset $from

string
getHtmlForColumnDropdown(string $db, string $selected_tbl)

build dropdown select html to select column in selected table, include only columns which are not already in central list

string
getHtmlForMain(string $db, int $total_rows, int $pos, string $pmaThemeImage, string $text_dir)

build html for adding a new user defined column to central list

Details

at line 72
__construct(DatabaseInterface $dbi)

Constructor

Parameters

DatabaseInterface $dbi DatabaseInterface instance

at line 91
array|bool getParams()

Defines the central_columns parameters for the current user

Return Value

array|bool the central_columns parameters for the current user

at line 125
array getColumnsList(string $db, int $from = 0, int $num = 25)

get $num columns of given database from central columns list starting at offset $from

Parameters

string $db selected database
int $from starting offset of first result
int $num maximum number of results to return

Return Value

array list of $num columns present in central columns list starting at offset $from for the given database

at line 160
int getCount(string $db)

Get the number of columns present in central list for given db

Parameters

string $db current database

Return Value

int number of columns in central list of columns for $db

at line 307
true|Message syncUniqueColumns(array $field_select, bool $isTable = true, string|null $table = null)

If $isTable is true then unique columns from given tables as $field_select are added to central list otherwise the $field_select is considered as list of columns and these columns are added to central list if not already added

Parameters

array $field_select if $isTable is true selected tables list otherwise selected columns list
bool $isTable if passed array is of tables or columns
string|null $table if $isTable is false, then table name to which columns belong

Return Value

true|Message

at line 428
true|Message deleteColumnsFromList(string $database, array $field_select, bool $isTable = true)

if $isTable is true it removes all columns of given tables as $field_select from central columns list otherwise $field_select is columns list and it removes given columns if present in central list

Parameters

string $database Database name
array $field_select if $isTable selected list of tables otherwise selected list of columns to remove from central list
bool $isTable if passed array is of tables or columns

Return Value

true|Message

at line 514
true|Message makeConsistentWithList(string $db, array $selected_tables)

Make the columns of given tables consistent with central list of columns.

Updates only those columns which are not being referenced.

Parameters

string $db current database
array $selected_tables list of selected tables.

Return Value

true|Message

at line 589
array getFromTable(string $db, string $table, bool $allFields = false)

return the columns present in central list of columns for a given table of a given database

Parameters

string $db given database
string $table given table
bool $allFields set if need all the fields of existing columns, otherwise only column_name is returned

Return Value

array columns present in central list from given table of given db.

at line 632
true|Message updateOneColumn(string $db, string $orig_col_name, string $col_name, string $col_type, string $col_attribute, string $col_length, int $col_isNull, string $collation, string $col_extra, string $col_default)

update a column in central columns list if a edit is requested

Parameters

string $db current database
string $orig_col_name original column name before edit
string $col_name new column name
string $col_type new column type
string $col_attribute new column attribute
string $col_length new column length
int $col_isNull value 1 if new column isNull is true, 0 otherwise
string $collation new column collation
string $col_extra new column extra property
string $col_default new column default value

Return Value

true|Message

at line 690
true|Message updateMultipleColumn(array $params)

Update Multiple column in central columns list if a change is requested

Parameters

array $params Request parameters

Return Value

true|Message

at line 883
array getListRaw(string $db, string $table)

get the list of columns in given database excluding the columns present in current table

Parameters

string $db selected database
string $table current table name

Return Value

array encoded list of columns present in central list for the given database

at line 930
string getTableFooter(string $pmaThemeImage, string $text_dir)

Get HTML for "check all" check box with "with selected" dropdown

Parameters

string $pmaThemeImage pma theme image url
string $text_dir url for text directory

Return Value

string

at line 1009
string getHtmlForEditingPage(array $selected_fld, string $selected_db)

Get HTML for editing page central columns

Parameters

array $selected_fld Array containing the selected fields
string $selected_db String containing the name of database

Return Value

string HTML for complete editing page for central columns

at line 1056
int getColumnsCount(string $db, int $from = 0, int $num = 25)

get number of columns of given database from central columns list starting at offset $from

Parameters

string $db selected database
int $from starting offset of first result
int $num maximum number of results to return

Return Value

int count of $num columns present in central columns list starting at offset $from for the given database

at line 1092
string getHtmlForColumnDropdown(string $db, string $selected_tbl)

build dropdown select html to select column in selected table, include only columns which are not already in central list

Parameters

string $db current database to which selected table belongs
string $selected_tbl selected table

Return Value

string html to select column

at line 1123
string getHtmlForMain(string $db, int $total_rows, int $pos, string $pmaThemeImage, string $text_dir)

build html for adding a new user defined column to central list

Parameters

string $db current database
int $total_rows number of rows in central columns
int $pos offset of first result with complete result set
string $pmaThemeImage table footer theme image directorie
string $text_dir table footer arrow direction

Return Value

string html of the form to let user add a new user defined column to the list