4
4
namespace Doctrine \DBAL \Jaeger \Decorator ;
5
5
6
6
use Closure ;
7
+ use Doctrine \Common \EventManager ;
7
8
use Doctrine \DBAL \Cache \QueryCacheProfile ;
9
+ use Doctrine \DBAL \Configuration ;
8
10
use Doctrine \DBAL \Connection ;
11
+ use Doctrine \DBAL \Driver ;
12
+ use Doctrine \DBAL \Driver \Connection as DriverConnection ;
13
+ use Doctrine \DBAL \Exception ;
9
14
use Doctrine \DBAL \ParameterType ;
15
+ use Doctrine \DBAL \Platforms \AbstractPlatform ;
16
+ use Doctrine \DBAL \Query \Expression \ExpressionBuilder ;
10
17
use Doctrine \DBAL \Query \QueryBuilder ;
11
18
use Doctrine \DBAL \Result ;
19
+ use Doctrine \DBAL \Schema \AbstractSchemaManager ;
12
20
use Doctrine \DBAL \Statement ;
21
+ use Doctrine \DBAL \Types \Type ;
13
22
14
23
abstract class AbstractConnectionDecorator extends Connection
15
24
{
@@ -66,122 +75,142 @@ public function rollBack(): bool
66
75
return $ this ->connection ->rollBack ();
67
76
}
68
77
69
- public function errorCode ()
78
+ public function getParams (): array
70
79
{
71
- return $ this ->connection ->errorCode ();
80
+ return $ this ->connection ->getParams ();
72
81
}
73
82
74
- public function errorInfo ()
83
+ public function getDatabase (): ? string
75
84
{
76
- return $ this ->connection ->errorInfo ();
85
+ return $ this ->connection ->getDatabase ();
77
86
}
78
87
79
- public function getParams ()
88
+ public function getDriver (): Driver
80
89
{
81
- return $ this ->connection ->getParams ();
90
+ return $ this ->connection ->getDriver ();
82
91
}
83
92
84
- public function getDatabase ()
93
+ public function getConfiguration (): Configuration
85
94
{
86
- return $ this ->connection ->getDatabase ();
95
+ return $ this ->connection ->getConfiguration ();
87
96
}
88
97
89
- public function getHost ()
98
+ public function getEventManager (): EventManager
90
99
{
91
- return $ this ->connection ->getHost ();
100
+ return $ this ->connection ->getEventManager ();
92
101
}
93
102
94
- public function getPort ()
103
+ public function getDatabasePlatform (): AbstractPlatform
95
104
{
96
- return $ this ->connection ->getPort ();
105
+ return $ this ->connection ->getDatabasePlatform ();
97
106
}
98
107
99
- public function getUsername ()
108
+ public function getExpressionBuilder (): ExpressionBuilder
100
109
{
101
- return $ this ->connection ->getUsername ();
110
+ return $ this ->connection ->getExpressionBuilder ();
102
111
}
103
112
104
- public function getPassword ()
113
+ public function createExpressionBuilder (): ExpressionBuilder
105
114
{
106
- return $ this ->connection ->getPassword ();
115
+ return $ this ->connection ->createExpressionBuilder ();
107
116
}
108
117
109
- public function getDriver ()
118
+ public function connect (): bool
110
119
{
111
- return $ this ->connection ->getDriver ();
120
+ return $ this ->connection ->connect ();
112
121
}
113
122
114
- public function getConfiguration ()
123
+ public function isAutoCommit (): bool
115
124
{
116
- return $ this ->connection ->getConfiguration ();
125
+ return $ this ->connection ->isAutoCommit ();
117
126
}
118
127
119
- public function getEventManager ()
128
+ public function setAutoCommit ( $ autoCommit ): void
120
129
{
121
- return $ this ->connection ->getEventManager ( );
130
+ $ this ->connection ->setAutoCommit ( $ autoCommit );
122
131
}
123
132
124
- public function getDatabasePlatform ( )
133
+ public function fetchAssociative ( string $ query , array $ params = [], array $ types = [] )
125
134
{
126
- return $ this ->connection ->getDatabasePlatform ( );
135
+ return $ this ->connection ->fetchAssociative ( $ query , $ params , $ types );
127
136
}
128
137
129
- public function getExpressionBuilder ( )
138
+ public function fetchNumeric ( string $ query , array $ params = [], array $ types = [] )
130
139
{
131
- return $ this ->connection ->getExpressionBuilder ( );
140
+ return $ this ->connection ->fetchNumeric ( $ query , $ params , $ types );
132
141
}
133
142
134
- public function connect (): bool
143
+ public function fetchOne ( string $ query , array $ params = [], array $ types = [])
135
144
{
136
- return $ this ->connection ->connect ( );
145
+ return $ this ->connection ->fetchOne ( $ query , $ params , $ types );
137
146
}
138
147
139
- public function isAutoCommit ()
148
+ public function fetchAllNumeric ( string $ query , array $ params = [], array $ types = []): array
140
149
{
141
- return $ this ->connection ->isAutoCommit ( );
150
+ return $ this ->connection ->fetchAllNumeric ( $ query , $ params , $ types );
142
151
}
143
152
144
- public function setAutoCommit ( $ autoCommit )
153
+ public function fetchAllAssociative ( string $ query , array $ params = [], array $ types = []): array
145
154
{
146
- $ this ->connection ->setAutoCommit ($ autoCommit );
155
+ return $ this ->connection ->fetchAllAssociative ($ query , $ params , $ types );
156
+ }
157
+
158
+ public function fetchAllKeyValue (string $ query , array $ params = [], array $ types = []): array
159
+ {
160
+ return $ this ->connection ->fetchAllKeyValue ($ query , $ params , $ types );
147
161
}
148
162
149
- public function setFetchMode ( $ fetchMode )
163
+ public function fetchAllAssociativeIndexed ( string $ query , array $ params = [], array $ types = []): array
150
164
{
151
- $ this ->connection ->setFetchMode ( $ fetchMode );
165
+ return $ this ->connection ->fetchAllAssociativeIndexed ( $ query , $ params , $ types );
152
166
}
153
167
154
- public function fetchAssoc ( $ statement , array $ params = [], array $ types = [])
168
+ public function fetchFirstColumn ( string $ query , array $ params = [], array $ types = []): array
155
169
{
156
- return $ this ->connection ->fetchAssoc ( $ statement , $ params , $ types );
170
+ return $ this ->connection ->fetchFirstColumn ( $ query , $ params , $ types );
157
171
}
158
172
159
- public function fetchArray ( $ statement , array $ params = [], array $ types = [])
173
+ public function iterateNumeric ( string $ query , array $ params = [], array $ types = []): \ Traversable
160
174
{
161
- return $ this ->connection ->fetchArray ( $ statement , $ params , $ types );
175
+ return $ this ->connection ->iterateNumeric ( $ query , $ params , $ types );
162
176
}
163
177
164
- public function fetchColumn ( $ statement , array $ params = [], $ column = 0 , array $ types = [])
178
+ public function iterateAssociative ( string $ query , array $ params = [], array $ types = []): \ Traversable
165
179
{
166
- return $ this ->connection ->fetchColumn ( $ statement , $ params, $ column , $ types );
180
+ return $ this ->connection ->iterateAssociative ( $ query , $ params , $ types );
167
181
}
168
182
169
- public function isConnected ()
183
+ public function iterateKeyValue (string $ query , array $ params = [], array $ types = []): \Traversable
184
+ {
185
+ return $ this ->connection ->iterateKeyValue ($ query , $ params , $ types );
186
+ }
187
+
188
+ public function iterateAssociativeIndexed (string $ query , array $ params = [], array $ types = []): \Traversable
189
+ {
190
+ return $ this ->connection ->iterateAssociativeIndexed ($ query , $ params , $ types );
191
+ }
192
+
193
+ public function iterateColumn (string $ query , array $ params = [], array $ types = []): \Traversable
194
+ {
195
+ return $ this ->connection ->iterateColumn ($ query , $ params , $ types );
196
+ }
197
+
198
+ public function isConnected (): bool
170
199
{
171
200
return $ this ->connection ->isConnected ();
172
201
}
173
202
174
- public function isTransactionActive ()
203
+ public function isTransactionActive (): bool
175
204
{
176
205
return $ this ->connection ->isTransactionActive ();
177
206
}
178
207
179
- public function delete ($ tableExpression , array $ identifier , array $ types = [])
208
+ public function delete ($ table , array $ criteria , array $ types = [])
180
209
{
181
- return $ this ->connection ->delete ($ tableExpression , $ identifier , $ types );
210
+ return $ this ->connection ->delete ($ table , $ criteria , $ types );
182
211
}
183
212
184
- public function close ()
213
+ public function close (): void
185
214
{
186
215
$ this ->connection ->close ();
187
216
}
@@ -191,52 +220,47 @@ public function setTransactionIsolation($level)
191
220
$ this ->connection ->setTransactionIsolation ($ level );
192
221
}
193
222
194
- public function getTransactionIsolation ()
223
+ public function getTransactionIsolation (): int
195
224
{
196
225
return $ this ->connection ->getTransactionIsolation ();
197
226
}
198
227
199
- public function update ($ tableExpression , array $ data , array $ identifier , array $ types = [])
228
+ public function update ($ table , array $ data , array $ criteria , array $ types = [])
200
229
{
201
- return $ this ->connection ->update ($ tableExpression , $ data , $ identifier , $ types );
230
+ return $ this ->connection ->update ($ table , $ data , $ criteria , $ types );
202
231
}
203
232
204
- public function insert ($ tableExpression , array $ data , array $ types = [])
233
+ public function insert ($ table , array $ data , array $ types = [])
205
234
{
206
- return $ this ->connection ->insert ($ tableExpression , $ data , $ types );
235
+ return $ this ->connection ->insert ($ table , $ data , $ types );
207
236
}
208
237
209
- public function quoteIdentifier ($ str )
238
+ public function quoteIdentifier ($ str ): string
210
239
{
211
240
return $ this ->connection ->quoteIdentifier ($ str );
212
241
}
213
242
214
- public function fetchAll ($ sql , array $ params = [], $ types = [])
215
- {
216
- return $ this ->connection ->fetchAll ($ sql , $ params , $ types );
217
- }
218
-
219
243
public function executeQuery (string $ sql , array $ params = [], $ types = [], QueryCacheProfile $ qcp = null ): Result
220
244
{
221
245
return $ this ->connection ->executeQuery ($ sql , $ params , $ types , $ qcp );
222
246
}
223
247
224
- public function executeCacheQuery ($ query , $ params , $ types , QueryCacheProfile $ qcp )
248
+ public function executeCacheQuery ($ sql , $ params , $ types , QueryCacheProfile $ qcp ): Result
225
249
{
226
- return $ this ->connection ->executeCacheQuery ($ query , $ params , $ types , $ qcp );
250
+ return $ this ->connection ->executeCacheQuery ($ sql , $ params , $ types , $ qcp );
227
251
}
228
252
229
- public function project ( $ query , array $ params, Closure $ function )
253
+ public function executeStatement ( $ sql , array $ params = [], array $ types = [] )
230
254
{
231
- return $ this ->connection ->project ( $ query , $ params , $ function );
255
+ return $ this ->connection ->executeStatement ( $ sql , $ params , $ types );
232
256
}
233
257
234
258
public function executeUpdate (string $ sql , array $ params = [], array $ types = []): int
235
259
{
236
260
return $ this ->connection ->executeUpdate ($ sql , $ params , $ types );
237
261
}
238
262
239
- public function getTransactionNestingLevel ()
263
+ public function getTransactionNestingLevel (): int
240
264
{
241
265
return $ this ->connection ->getTransactionNestingLevel ();
242
266
}
@@ -246,47 +270,57 @@ public function transactional(Closure $func)
246
270
return $ this ->connection ->transactional ($ func );
247
271
}
248
272
249
- public function setNestTransactionsWithSavepoints ($ nestTransactionsWithSavepoints )
273
+ public function setNestTransactionsWithSavepoints ($ nestTransactionsWithSavepoints ): void
250
274
{
251
275
$ this ->connection ->setNestTransactionsWithSavepoints ($ nestTransactionsWithSavepoints );
252
276
}
253
277
254
- public function getNestTransactionsWithSavepoints ()
278
+ public function getNestTransactionsWithSavepoints (): bool
255
279
{
256
280
return $ this ->connection ->getNestTransactionsWithSavepoints ();
257
281
}
258
282
259
- public function createSavepoint ($ savepoint )
283
+ public function createSavepoint ($ savepoint ): void
260
284
{
261
285
$ this ->connection ->createSavepoint ($ savepoint );
262
286
}
263
287
264
- public function releaseSavepoint ($ savepoint )
288
+ public function releaseSavepoint ($ savepoint ): void
265
289
{
266
290
$ this ->connection ->releaseSavepoint ($ savepoint );
267
291
}
268
292
269
- public function rollbackSavepoint ($ savepoint )
293
+ public function rollbackSavepoint ($ savepoint ): void
270
294
{
271
295
$ this ->connection ->rollbackSavepoint ($ savepoint );
272
296
}
273
297
274
- public function getWrappedConnection ()
298
+ public function getWrappedConnection (): DriverConnection
275
299
{
276
300
return $ this ->connection ->getWrappedConnection ();
277
301
}
278
302
279
- public function getSchemaManager ()
303
+ public function getNativeConnection ()
304
+ {
305
+ return $ this ->connection ->getNativeConnection ();
306
+ }
307
+
308
+ public function getSchemaManager (): AbstractSchemaManager
280
309
{
281
310
return $ this ->connection ->getSchemaManager ();
282
311
}
283
312
284
- public function setRollbackOnly ()
313
+ public function createSchemaManager (): AbstractSchemaManager
314
+ {
315
+ return $ this ->connection ->createSchemaManager ();
316
+ }
317
+
318
+ public function setRollbackOnly (): void
285
319
{
286
320
$ this ->connection ->setRollbackOnly ();
287
321
}
288
322
289
- public function isRollbackOnly ()
323
+ public function isRollbackOnly (): bool
290
324
{
291
325
return $ this ->connection ->isRollbackOnly ();
292
326
}
@@ -301,18 +335,8 @@ public function convertToPHPValue($value, $type)
301
335
return $ this ->connection ->convertToPHPValue ($ value , $ type );
302
336
}
303
337
304
- public function resolveParams (array $ params , array $ types )
305
- {
306
- return $ this ->connection ->resolveParams ($ params , $ types );
307
- }
308
-
309
- public function createQueryBuilder ()
310
- {
311
- return new QueryBuilder ($ this );
312
- }
313
-
314
- public function ping ()
338
+ public function createQueryBuilder (): QueryBuilder
315
339
{
316
- return $ this ->connection ->ping ();
340
+ return $ this ->connection ->createQueryBuilder ();
317
341
}
318
342
}
0 commit comments