You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Tracing/Doctrine/DBAL/TracingDriverConnection.php
+10-8Lines changed: 10 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -167,26 +167,28 @@ public function rollBack(): bool
167
167
168
168
/**
169
169
* {@inheritdoc}
170
+
*
171
+
* @return resource|object
170
172
*/
171
-
publicfunctionerrorCode(): ?string
173
+
publicfunctiongetNativeConnection()
172
174
{
173
-
if (method_exists($this->decoratedConnection, 'errorCode')) {
174
-
return$this->decoratedConnection->errorCode();
175
+
if (!method_exists($this->decoratedConnection, 'getNativeConnection')) {
176
+
thrownewBadMethodCallException(sprintf('The connection "%s" does not support accessing the native connection.', \get_class($this->decoratedConnection)));
175
177
}
176
178
177
-
thrownew \BadMethodCallException(sprintf('The %s() method is not supported on Doctrine DBAL 3.0.', __METHOD__));
if (!method_exists($this->decoratedConnection, 'getNativeConnection')) {
186
-
thrownewBadMethodCallException(sprintf('The connection "%s" does not support accessing the native connection.', \get_class($this->decoratedConnection)));
187
+
if (method_exists($this->decoratedConnection, 'errorCode')) {
@@ -118,6 +119,20 @@ public function getServerVersion(): string
118
119
return$wrappedConnection->getServerVersion();
119
120
}
120
121
122
+
/**
123
+
* {@inheritdoc}
124
+
*
125
+
* @return resource|object
126
+
*/
127
+
publicfunctiongetNativeConnection()
128
+
{
129
+
if (!method_exists($this->decoratedConnection, 'getNativeConnection')) {
130
+
thrownewBadMethodCallException(sprintf('The connection "%s" does not support accessing the native connection.', \get_class($this->decoratedConnection)));
if (!method_exists($this->decoratedConnection, 'getNativeConnection')) {
171
-
thrownewLogicException(sprintf('The decoratedConnection %s does not support accessing the native connection.', \get_class($this->decoratedConnection)));
0 commit comments