File tree Expand file tree Collapse file tree 2 files changed +17
-17
lines changed Expand file tree Collapse file tree 2 files changed +17
-17
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,13 @@ class Connection implements ConnectionInterface
49
49
*/
50
50
protected $ database ;
51
51
52
+ /**
53
+ * The type of the connection.
54
+ *
55
+ * @var string|null
56
+ */
57
+ protected $ type ;
58
+
52
59
/**
53
60
* The table prefix for the connection.
54
61
*
@@ -161,13 +168,6 @@ class Connection implements ConnectionInterface
161
168
*/
162
169
protected static $ resolvers = [];
163
170
164
- /**
165
- * The type of the connection.
166
- *
167
- * @var string|null
168
- */
169
- protected $ type ;
170
-
171
171
/**
172
172
* Create a new database connection instance.
173
173
*
@@ -1057,9 +1057,9 @@ public function getName()
1057
1057
*
1058
1058
* @return string|null
1059
1059
*/
1060
- public function getFullName ()
1060
+ public function getNameWithReadWriteType ()
1061
1061
{
1062
- return $ this ->getName ().($ this ->type ? ':: ' .$ this ->type : '' );
1062
+ return $ this ->getName ().($ this ->readWriteType ? ':: ' .$ this ->readWriteType : '' );
1063
1063
}
1064
1064
1065
1065
/**
@@ -1292,14 +1292,14 @@ public function setDatabaseName($database)
1292
1292
}
1293
1293
1294
1294
/**
1295
- * Set the type of the connection.
1295
+ * Set the read / write type of the connection.
1296
1296
*
1297
- * @param string $type
1297
+ * @param string|null $readWriteType
1298
1298
* @return $this
1299
1299
*/
1300
- public function setType ( $ type )
1300
+ public function setReadWriteType ( $ readWriteType )
1301
1301
{
1302
- $ this ->type = $ type ;
1302
+ $ this ->readWriteType = $ readWriteType ;
1303
1303
1304
1304
return $ this ;
1305
1305
}
Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ public function __construct($app, ConnectionFactory $factory)
62
62
$ this ->factory = $ factory ;
63
63
64
64
$ this ->reconnector = function ($ connection ) {
65
- $ this ->reconnect ($ connection ->getFullName ());
65
+ $ this ->reconnect ($ connection ->getNameWithReadWriteType ());
66
66
};
67
67
}
68
68
@@ -165,7 +165,7 @@ protected function configuration($name)
165
165
*/
166
166
protected function configure (Connection $ connection , $ type )
167
167
{
168
- $ connection = $ this ->setPdoForType ($ connection , $ type )->setType ($ type );
168
+ $ connection = $ this ->setPdoForType ($ connection , $ type )->setReadWriteType ($ type );
169
169
170
170
// First we'll set the fetch mode and a few other dependencies of the database
171
171
// connection. This method basically just configures and prepares it to get
@@ -282,8 +282,8 @@ protected function refreshPdoConnections($name)
282
282
);
283
283
284
284
return $ this ->connections [$ name ]
285
- ->setPdo ($ fresh ->getRawPdo ())
286
- ->setReadPdo ($ fresh ->getRawReadPdo ());
285
+ ->setPdo ($ fresh ->getRawPdo ())
286
+ ->setReadPdo ($ fresh ->getRawReadPdo ());
287
287
}
288
288
289
289
/**
You can’t perform that action at this time.
0 commit comments