1 | <?php |
||
24 | class MediaWikiQueryInterface implements QueryInterface { |
||
25 | |||
26 | /** |
||
27 | * @var DBConnectionProvider |
||
28 | */ |
||
29 | private $connectionProvider; |
||
30 | |||
31 | /** |
||
32 | * @since 0.1 |
||
33 | * |
||
34 | * @param DBConnectionProvider $connectionProvider |
||
35 | */ |
||
36 | public function __construct( DBConnectionProvider $connectionProvider ) { |
||
39 | |||
40 | /** |
||
41 | * @return DatabaseBase |
||
42 | */ |
||
43 | private function getDB() { |
||
46 | |||
47 | /** |
||
48 | * @see QueryInterface::tableExists |
||
49 | * |
||
50 | * @since 0.1 |
||
51 | * |
||
52 | * @param string $tableName |
||
53 | * |
||
54 | * @return bool |
||
55 | */ |
||
56 | public function tableExists( $tableName ) { |
||
59 | |||
60 | /** |
||
61 | * @see QueryInterface::insert |
||
62 | * |
||
63 | * @since 0.1 |
||
64 | * |
||
65 | * @param string $tableName |
||
66 | * @param array $values |
||
67 | * |
||
68 | * @throws InsertFailedException |
||
69 | */ |
||
70 | public function insert( $tableName, array $values ) { |
||
81 | |||
82 | /** |
||
83 | * @see QueryInterface::update |
||
84 | * |
||
85 | * @since 0.1 |
||
86 | * |
||
87 | * @param string $tableName |
||
88 | * @param array $values |
||
89 | * @param array $conditions |
||
90 | * |
||
91 | * @throws UpdateFailedException |
||
92 | */ |
||
93 | public function update( $tableName, array $values, array $conditions ) { |
||
104 | |||
105 | /** |
||
106 | * @see QueryInterface::delete |
||
107 | * |
||
108 | * @since 0.1 |
||
109 | * |
||
110 | * @param string $tableName |
||
111 | * @param array $conditions |
||
112 | * |
||
113 | * @throws DeleteFailedException |
||
114 | */ |
||
115 | public function delete( $tableName, array $conditions ) { |
||
126 | |||
127 | /** |
||
128 | * @see QueryInterface::getInsertId |
||
129 | * |
||
130 | * @since 0.1 |
||
131 | * |
||
132 | * @throws QueryInterfaceException |
||
133 | * @return int |
||
134 | */ |
||
135 | public function getInsertId() { |
||
144 | |||
145 | /** |
||
146 | * @see QueryInterface::select |
||
147 | * |
||
148 | * @since 0.1 |
||
149 | * |
||
150 | * @param string $tableName |
||
151 | * @param string[] $fieldNames |
||
152 | * @param array $conditions |
||
153 | * @param array $options |
||
154 | * |
||
155 | * @throws SelectFailedException |
||
156 | * @return Iterator |
||
157 | */ |
||
158 | public function select( $tableName, array $fieldNames, array $conditions, array $options = array() ) { |
||
174 | |||
175 | } |
||
176 |