-
Notifications
You must be signed in to change notification settings - Fork 116
Expand file tree
/
Copy pathclass-db-driver.php
More file actions
executable file
·63 lines (56 loc) · 1.17 KB
/
class-db-driver.php
File metadata and controls
executable file
·63 lines (56 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
/**
* Interface for a Database Driver.
*
* @todo Review. Heavy refactor maybe needed.
* @package WP_Stream
*/
namespace WP_Stream;
/**
* Interface - DB_Driver
*/
interface DB_Driver {
/**
* Insert a record
*
* @param array $data Data to be insert into the database.
*
* @return int
*/
public function insert_record( $data );
/**
* Retrieve records
*
* @param array $args Argument to filter the result by.
*
* @return array
*/
public function get_records( $args );
/**
* Returns array of existing values for requested column.
* Used to fill search filters with only used items, instead of all items.
*
* @param string $column Column to pull data from.
*
* @return array
*/
public function get_column_values( $column );
/**
* Public getter to return the names of the tables this driver manages.
*
* @return array
*/
public function get_table_names();
/**
* Init storage.
*
* @param \WP_Stream\Plugin $plugin Instance of the plugin.
*/
public function setup_storage( $plugin );
/**
* Purge storage.
*
* @param \WP_Stream\Plugin $plugin Instance of the plugin.
*/
public function purge_storage( $plugin );
}