PHP Class WPDKDBListTableModel

PHP does not allow to inherit from more than one class. So one way to solve the problem is to provide a pointer to the class that you want to inherit. This class, therefore, is as if it were understood in this way: class WPDKDBListTableModel extends WPDKListTableModel, WPDKDBTableModel }
Author: =undo= ([email protected])
Inheritance: extends WPDKListTableModel
Datei anzeigen Open project: wpxtreme/wpdk

Public Properties

Property Type Description
$table WPDKDBTableModel PHP does not allow to inherit from more than one class. So one way to solve the problem is to provide a pointer to the class that you want to inherit.

Public Methods

Method Description
__construct ( string $table_name = '', string $sql_file = '' ) : WPDKDBListTableModel Create an instance of WPDKDBListTableModel class
count ( ) : integer | array Return the integer count of all rows when $distinct param is emmpty or an array of distinct count for $distinct column.
delete ( integer | array $id ) : integer | boolean Delete one or more record from table. Return the number of rows affected/selected or false on error.
insert ( ) : integer | boolean Insert a record by values. Return FALSE if error or id of record if successfully.
status ( integer $id, string $status = WPDKDBTableRowStatuses::PUBLISH ) : mixed Set one or more record with a status.
update ( ) : array | boolean Update a record by values. Return FALSE if error or the $where condiction if successfully.

Method Details

__construct() public method

Create an instance of WPDKDBListTableModel class
public __construct ( string $table_name = '', string $sql_file = '' ) : WPDKDBListTableModel
$table_name string Optional. The name of the database table without WordPress prefix
$sql_file string Optional. The filename of SQL file with the database table structure and init data.
return WPDKDBListTableModel

count() public method

Return the integer count of all rows when $distinct param is emmpty or an array of distinct count for $distinct column.
public count ( ) : integer | array
return integer | array

delete() public method

Use the primaryKey. You can override this method in your subclass.
Since: 1.5.16
public delete ( integer | array $id ) : integer | boolean
$id integer | array Any single int or array list of primary keys
return integer | boolean

insert() public method

You can override this method in your subclass.
public insert ( ) : integer | boolean
return integer | boolean

status() public method

Set one or more record with a status.
public status ( integer $id, string $status = WPDKDBTableRowStatuses::PUBLISH ) : mixed
$id integer Record ID
$status string Optional. The status, default WPDKDBTableRowStatuses::PUBLISH
return mixed

update() public method

You can use the $where condiction returned to get again the record ID. You can override this method in your subclass.
public update ( ) : array | boolean
return array | boolean

Property Details

$table public_oe property

PHP does not allow to inherit from more than one class. So one way to solve the problem is to provide a pointer to the class that you want to inherit.
public WPDKDBTableModel $table
return WPDKDBTableModel