Db
Database class
Namespace: WebberZone\Contextual_Related_Posts\Admin
Since: 3.5.0
Source: includes/admin/class-db.php line 21
Methods
__construct()
Constructor class.
Since: 3.5.0
Line: 36
public function __construct( );
get_fulltext_indexes() static
Get the list of fulltext indexes to be created on the posts table.
Since: 4.0.1
Line: 46
static public function get_fulltext_indexes( ): array;
Returns: array — Array of fulltext indexes with their respective columns.
get_old_fulltext_indexes() static
Get the list of old fulltext indexes.
Since: 4.1.0
Line: 70
static public function get_old_fulltext_indexes( ): array;
Returns: array — Array of fulltext indexes with their respective columns.
get_legacy_index_aliases() static
Get the map of current index names to the legacy index name each one replaces.
The wz_ indexes are shared across WebberZone plugins, so a sibling plugin’s index on the same columns satisfies ours.
Since: 4.3.1
Line: 89
static public function get_legacy_index_aliases( ): array;
Returns: array — Map of current index name => legacy index name.
maybe_heal_fulltext_indexes() static
Create any missing FULLTEXT indexes once per index schema version.
Existing installs never re-run activation, so a newly registered index would otherwise wait on the user clicking through the missing-index notice.
Since: 4.3.1
Line: 115
static public function maybe_heal_fulltext_indexes( );
install_fulltext_index() static
Install a fulltext index on the posts table.
Since: 4.1.0
Line: 146
static public function install_fulltext_index( $index, $columns ): void;
| Type | Name | Description |
|---|---|---|
string |
$index |
Index name. |
string |
$columns |
Columns to be indexed. |
Returns: void
create_fulltext_indexes() static
Create fulltext indexes on the posts table.
Since: 3.5.0
Line: 158
static public function create_fulltext_indexes( );
delete_fulltext_indexes() static
Delete the FULLTEXT index.
Since: 3.5.0
Line: 179
static public function delete_fulltext_indexes( );
is_index_installed() static
Check if a fulltext index already exists on the posts table.
Since: 4.1.0
Line: 200
static public function is_index_installed( $index ): bool;
| Type | Name | Description |
|---|---|---|
string |
$index |
Index name. |
Returns: bool — True if the index exists, false otherwise.
index_exists() static
Check if an index with this exact name exists on the posts table.
Unlike is_index_installed(), this ignores legacy aliases - use it when acting on the index itself, e.g. building DROP statements.
Since: 4.3.1
Line: 221
static public function index_exists( $index ): bool;
| Type | Name | Description |
|---|---|---|
string |
$index |
Index name. |
Returns: bool — True if the index exists, false otherwise.
is_fulltext_index_installed() static
Check if all fulltext indexes are installed.
Since: 4.1.0
Line: 249
static public function is_fulltext_index_installed( ): bool;
Returns: bool — True if all fulltext indexes are installed, false if any are missing.
check_fulltext_indexes() static
Check the status of all fulltext indexes.
Since: 4.1.0
Line: 268
static public function check_fulltext_indexes( ): array;
Returns: array — Array of index statuses with ‘installed’ boolean flag and ‘status’ text.