PHP Class _WPDKDBTable

## Overview Let's we say that is not easy design and coding a well done CRUD engine for WordPress. However we have try to do this in a simple first release.
Deprecation: Since 0.9
Author: =undo= ([email protected])
Show file Open project: wpxtreme/wpdk

Public Properties

Property Type Description
$arrayStatuses array
$sdfArrayStatuses array
$tableName string
$wpdb wpdb

Public Methods

Method Description
__construct ( string $tableName, string $index_name = 'id' ) : _WPDKDBTable
arrayStatusesGroupBy ( ) : array
count ( ) : integer
delete ( array | integer $indexes ) : boolean | integer
query ( string $where = '1' ) : array | null
tableName ( string $tableName ) : string
update ( array | integer $indexes, array $fields ) : boolean | integer

Protected Methods

Method Description
arrayStatuses ( ) : array
sdfArrayStatuses ( ) : array
updateTable ( string $sql_filename, string $tableName )

Method Details

__construct() public method

public __construct ( string $tableName, string $index_name = 'id' ) : _WPDKDBTable
$tableName string Table name without WordPress prefix
$index_name string Optional index name, default `id`
return _WPDKDBTable

arrayStatuses() protected method

protected arrayStatuses ( ) : array
return array

arrayStatusesGroupBy() public method

public arrayStatusesGroupBy ( ) : array
return array

count() public method

public count ( ) : integer
return integer

delete() public method

public delete ( array | integer $indexes ) : boolean | integer
$indexes array | integer List of index or single index
return boolean | integer

query() public method

public query ( string $where = '1' ) : array | null
$where string
return array | null Array of object or NULL

sdfArrayStatuses() protected method

protected sdfArrayStatuses ( ) : array
return array

tableName() static public method

static public tableName ( string $tableName ) : string
$tableName string Simple table name
return string Complete WordPress table name

update() public method

public update ( array | integer $indexes, array $fields ) : boolean | integer
$indexes array | integer List of index or single index
$fields array Key value pairs array field => value
return boolean | integer

updateTable() protected static method

protected static updateTable ( string $sql_filename, string $tableName )
$sql_filename string Complete path of sql file
$tableName string Simple table name without WordPress Prefix. The WordPress prefix is auto add by this method

Property Details

$arrayStatuses public property

public array $arrayStatuses
return array

$sdfArrayStatuses public property

public array $sdfArrayStatuses
return array

$tableName public property

public string $tableName
return string

$wpdb public property

public wpdb $wpdb
return wpdb