| 1 |
<?php |
| 2 |
namespace WP_Stream; |
| 3 |
|
| 4 |
interface DB_Driver { |
| 5 |
/** |
| 6 |
* Insert a record |
| 7 |
* |
| 8 |
* @param array $data |
| 9 |
* |
| 10 |
* @return int |
| 11 |
*/ |
| 12 |
public function insert_record( $data ); |
| 13 |
|
| 14 |
/** |
| 15 |
* Retrieve records |
| 16 |
* |
| 17 |
* @param array $args |
| 18 |
* |
| 19 |
* @return array |
| 20 |
*/ |
| 21 |
public function get_records( $args ); |
| 22 |
|
| 23 |
/** |
| 24 |
* Returns array of existing values for requested column. |
| 25 |
* Used to fill search filters with only used items, instead of all items. |
| 26 |
* |
| 27 |
* @param string $column |
| 28 |
* |
| 29 |
* @return array |
| 30 |
*/ |
| 31 |
public function get_column_values( $column ); |
| 32 |
|
| 33 |
/** |
| 34 |
* Public getter to return table names |
| 35 |
* |
| 36 |
* @return array |
| 37 |
*/ |
| 38 |
public function get_table_names(); |
| 39 |
|
| 40 |
/** |
| 41 |
* Init storage. |
| 42 |
* |
| 43 |
* @param \WP_Stream\Plugin $plugin Instance of the plugin. |
| 44 |
*/ |
| 45 |
public function setup_storage( $plugin ); |
| 46 |
|
| 47 |
/** |
| 48 |
* Purge storage. |
| 49 |
* |
| 50 |
* @param \WP_Stream\Plugin $plugin Instance of the plugin. |
| 51 |
*/ |
| 52 |
public function purge_storage( $plugin ); |
| 53 |
} |
| 54 |
|