| 1 |
<?php |
| 2 |
/** |
| 3 |
* Interface for a Database Driver. |
| 4 |
* |
| 5 |
* @package MainWP/Dashboard |
| 6 |
*/ |
| 7 |
|
| 8 |
namespace MainWP\Dashboard\Module\Log; |
| 9 |
|
| 10 |
/** |
| 11 |
* Interface - Log_DB_Driver |
| 12 |
*/ |
| 13 |
interface Log_DB_Driver { |
| 14 |
/** |
| 15 |
* Insert a record |
| 16 |
* |
| 17 |
* @param array $data Data to be insert into the database. |
| 18 |
* |
| 19 |
* @return int |
| 20 |
*/ |
| 21 |
public function insert_record( $data ); |
| 22 |
|
| 23 |
/** |
| 24 |
* Retrieve records |
| 25 |
* |
| 26 |
* @param array $args Argument to filter the result by. |
| 27 |
* |
| 28 |
* @return array |
| 29 |
*/ |
| 30 |
public function get_records( $args ); |
| 31 |
|
| 32 |
/** |
| 33 |
* Returns array of existing values for requested column. |
| 34 |
* Used to fill search filters with only used items, instead of all items. |
| 35 |
* |
| 36 |
* @param string $column Column to pull data from. |
| 37 |
* |
| 38 |
* @return array |
| 39 |
*/ |
| 40 |
public function get_column_values( $column ); |
| 41 |
|
| 42 |
/** |
| 43 |
* Public getter to return the names of the tables this driver manages. |
| 44 |
* |
| 45 |
* @return array |
| 46 |
*/ |
| 47 |
public function get_table_names(); |
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
/** |
| 52 |
* Purge storage. |
| 53 |
* |
| 54 |
* @param \MainWP\Dashboard\Module\Log\Log_Manager $manager Instance of the manager. |
| 55 |
*/ |
| 56 |
public function purge_storage( $manager ); |
| 57 |
} |
| 58 |
|