Class DB_Table
Class DB_Table
- TheLeague\Database\Query_Builder
- Varunsridharan\WordPress\DB_Table
Namespace: Varunsridharan\WordPress
Package: Varunsridharan\WordPress
Author:
Varun Sridharan varunsridharan23@gmail.com
A base WordPress database table class, which facilitates the creation of and schema changes to individual database tables.
This class is intended to be extended for each unique database table, including global multisite tables and users tables.
It exists to make managing database tables in WordPress as easy as possible.
Extending this class comes with several automatic benefits: - Activation hook makes it great for plugins - Tables store their versions in the database independently - Tables upgrade via independent upgrade abstract methods - Multisite friendly - site tables switch on "switch_blog" action
Located at src/DB_Table.php
public
|
|
public static
|
|
abstract protected
|
|
abstract protected
|
|
abstract protected
mixed
|
|
abstract protected
mixed
|
|
public
|
|
public
|
|
protected
|
#
after_table_created( )
Works As A Built In Hook To Provide a Option to run after table is created. |
protected
string
|
$name
Table name, without the global table prefix |
#
''
|
protected
integer
|
$version
Database version |
#
0
|
protected
boolean
|
$global
Is this table for a site, or global |
#
false
|
protected
string
|
$db_version_key
Database version key (saved in _options or _sitemeta) |
#
''
|
protected
integer
|
$db_version
Current database version |
#
0
|
protected
string
|
$schema
Table schema |
#
''
|
protected
string
|
$prefix
|
#
null
|
protected
string
|
$charset_collation
Database character-set & collation for table |
#
''
|
protected
wpdb
|
$db
WPDB Database object (usually $GLOBALS['wpdb']) |
#
false
|
protected static
array
|
$_instances
Stores Multiple Class Instance. |
#
array()
|