| 1 |
<?php |
| 2 |
|
| 3 |
if (!defined('ABSPATH')) { |
| 4 |
exit; |
| 5 |
} |
| 6 |
|
| 7 |
/** |
| 8 |
* Table-name resolution and DDL introspection: prefix, plugin-table names, |
| 9 |
* CREATE TABLE DDL, table-level and column-level collations, existence, |
| 10 |
* and column-name listing. |
| 11 |
*/ |
| 12 |
interface ABJ_404_Solution_DatabaseTableMetadataInterface { |
| 13 |
|
| 14 |
/** |
| 15 |
* Get the normalized (lowercase) WordPress table prefix. |
| 16 |
* |
| 17 |
* @return string |
| 18 |
*/ |
| 19 |
public function getLowercasePrefix(): string; |
| 20 |
|
| 21 |
/** |
| 22 |
* Build a fully-qualified plugin table name. |
| 23 |
* |
| 24 |
* @param string $tableSuffix e.g. 'abj404_redirects' |
| 25 |
* @return string |
| 26 |
*/ |
| 27 |
public function getPrefixedTableName($tableSuffix): string; |
| 28 |
|
| 29 |
/** |
| 30 |
* Get the CREATE TABLE DDL for an existing table. |
| 31 |
* |
| 32 |
* @param string $tableName |
| 33 |
* @return string |
| 34 |
*/ |
| 35 |
public function getCreateTableDDL($tableName): string; |
| 36 |
|
| 37 |
/** |
| 38 |
* Get the table-level default collation for an existing table. |
| 39 |
* |
| 40 |
* @param string $tableName |
| 41 |
* @return string |
| 42 |
*/ |
| 43 |
public function getTableCollationString(string $tableName): string; |
| 44 |
|
| 45 |
/** |
| 46 |
* Get the column-level collation for an existing character column. |
| 47 |
* |
| 48 |
* @param string $tableName |
| 49 |
* @param string $columnName |
| 50 |
* @return string |
| 51 |
*/ |
| 52 |
public function getColumnCollationString(string $tableName, string $columnName): string; |
| 53 |
|
| 54 |
/** |
| 55 |
* Check whether a database table exists. |
| 56 |
* |
| 57 |
* @param string $tableName |
| 58 |
* @return bool |
| 59 |
*/ |
| 60 |
public function tableExists($tableName): bool; |
| 61 |
|
| 62 |
/** |
| 63 |
* Get column names from an actual database table. |
| 64 |
* |
| 65 |
* @param string $tableName |
| 66 |
* @return array<int, string> |
| 67 |
*/ |
| 68 |
public function getTableColumnNames(string $tableName): array; |
| 69 |
} |
| 70 |
|