Relation
class Relation (View source)
Set of functions used with the relation and PDF feature
Methods
No description
Check if the table is accessible
Check whether column_info table input transformation upgrade is required and try to upgrade silently
Gets all Relations to foreign tables for a given table or optionally a given column in a table
Gets all Relations to foreign tables for a given table or optionally a given column in a table
No description
Gets the display field of a table
Gets the comments for all columns of a table or the db itself
Gets the comment for a db
Set a database comment to a certain value.
Set a SQL history entry
Gets a SQL history entry
purges SQL history
Prepares the dropdown for one mode
Outputs dropdown with values of foreign fields
Gets foreign keys in preparation for a drop-down selector
Rename a field in relation tables
Performs SQL query used for renaming table.
Rename a table in relation tables
Get child table references for a table column.
Check child table references and foreign key for a table column.
Search a table column in foreign data.
No description
Returns default PMA table names and their create queries.
Create a database to be used as configuration storage
Creates PMA tables in the given db, updates if already exists.
Verifies that all pmadb features are disabled
Verifies if all the pmadb tables are defined
Get tables for foreign key constraint
No description
This function checks and initializes the phpMyAdmin configuration storage state before it is used into session cache.
Details
__construct(DatabaseInterface $dbi, Config|null $config = null)
No description
RelationParameters
getRelationParameters()
No description
bool
canAccessStorageTable(string $tableDbName)
Check if the table is accessible
bool
tryUpgradeTransformations()
Check whether column_info table input transformation upgrade is required and try to upgrade silently
array
getForeigners(string $db, string $table, string $column = '')
Gets all Relations to foreign tables for a given table or optionally a given column in a table
array
getForeignersInternal(string $db, string $table, string $column = '')
Gets all Relations to foreign tables for a given table or optionally a given column in a table
array
getForeignKeysData(string $db, string $table)
No description
string
getDisplayField(string $db, string $table)
Gets the display field of a table
array
getComments(string $db, string $table = '')
Gets the comments for all columns of a table or the db itself
string
getDbComment(string $db)
Gets the comment for a db
bool
setDbComment(string $db, string $comment = '')
Set a database comment to a certain value.
void
setHistory(string $db, string $table, string $username, string $sqlquery)
Set a SQL history entry
array|bool
getHistory(string $username)
Gets a SQL history entry
void
purgeHistory(string $username)
purges SQL history
deletes entries that exceeds $cfg['QueryHistoryMax'], oldest first, for the given user
array
buildForeignDropdown(array $foreign, string $data, string $mode)
Prepares the dropdown for one mode
string
foreignDropdown(array $dispRow, string $foreignField, string $foreignDisplay, string $data, int|null $max = null)
Outputs dropdown with values of foreign fields
ForeignData
getForeignData(array $foreigners, string $field, bool $overrideTotal, string $foreignFilter, string $foreignLimit, bool $getTotal = false)
Gets foreign keys in preparation for a drop-down selector
void
renameField(string $db, string $table, string $field, string $newName)
Rename a field in relation tables
usually called after a column in a table was renamed
void
renameSingleTable(DatabaseName $configStorageDatabase, TableName $configStorageTable, string $sourceDb, string $targetDb, string $sourceTable, string $targetTable, string $dbField, string $tableField)
Performs SQL query used for renaming table.
void
renameTable(string $sourceDb, string $targetDb, string $sourceTable, string $targetTable)
Rename a table in relation tables
usually called after table has been moved
int
createPage(string|null $newpage, PdfFeature $pdfFeature, string $db)
Create a PDF page
array
getChildReferences(string $db, string $table, string $column = '')
Get child table references for a table column.
This works only if 'DisableIS' is false. An empty array is returned otherwise.
array
checkChildForeignReferences(string $db, string $table, string $column, array|null $foreignersFull = null, array|null $childReferencesFull = null)
Check child table references and foreign key for a table column.
array|false
searchColumnInForeigners(array $foreigners, string $column)
Search a table column in foreign data.
array|false
getColumnFromForeignKeysData(array $foreignKeysData, string $column)
No description
array
getCreateTableSqlQueries(array $tableNameReplacements)
Returns default PMA table names and their create queries.
bool
createPmaDatabase(string $configurationStorageDbName)
Create a database to be used as configuration storage
void
fixPmaTables(string $db, bool $create = true)
Creates PMA tables in the given db, updates if already exists.
bool
arePmadbTablesAllDisabled()
Verifies that all pmadb features are disabled
bool
arePmadbTablesDefined()
Verifies if all the pmadb tables are defined
array
getTables(string $foreignDb, string $tblStorageEngine)
Get tables for foreign key constraint
string
getConfigurationStorageDbName()
No description
void
initRelationParamsCache()
This function checks and initializes the phpMyAdmin configuration storage state before it is used into session cache.