class CentralColumns (View source)

Properties

Template $template

Methods

__construct(DatabaseInterface $dbi)

No description

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
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

array
getColumnsNotInCentralList(string $db, string $table)

No description

array
getTemplateVariablesForMain(string $db, int $total_rows, int $pos, string $text_dir)

Adding a new user defined column to central list

Details

__construct(DatabaseInterface $dbi)

No description

Parameters

DatabaseInterface $dbi

DatabaseInterface instance

array|bool getParams()

Defines the central_columns parameters for the current user

Return Value

array|bool

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

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

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

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

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

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

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.

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

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

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

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

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

array getColumnsNotInCentralList(string $db, string $table)

No description

Parameters

string $db
string $table

Return Value

array

array getTemplateVariablesForMain(string $db, int $total_rows, int $pos, string $text_dir)

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 $text_dir

table footer arrow direction

Return Value

array