@@ -12,40 +12,31 @@ final class ConnectionManager
1212 *
1313 * @var TransactionPDO
1414 */
15- private $ masterConnection = null ;
15+ private $ masterConnection ;
1616
1717 /**
1818 * Slave database connection
1919 *
2020 * @var TransactionPDO|null
2121 */
22- private $ slaveConnection = null ;
22+ private $ slaveConnection ;
2323
2424 /**
2525 * PDOManager constructor
26- *
27- * @param string $name Unique name for connection
28- * @param array $config Configuration settings for database connection
29- */
30- public function __construct (string $ name , array $ config )
31- {
32- $ this ->setConnection ($ name , $ config );
33- }
34-
35- /**
3626 * Initialize connection to Database for master and slave (if applicable)
3727 *
3828 * @param string $name Unique name for connection
3929 * @param array $config Configuration settings for database connection
30+ * @param array $options Some specific options
4031 */
41- private function setConnection (string $ name , array $ config )
32+ public function __construct (string $ name , array $ config, array $ options = [] )
4233 {
4334 $ masterConf = $ config ['master ' ] ?? $ config ;
4435 $ slaveConf = $ config ['slave ' ] ?? [];
4536
46- $ this ->masterConnection = Engine::setConnection ($ name .'_master ' , $ masterConf );
37+ $ this ->masterConnection = Engine::setConnection ($ name .'_master ' , $ masterConf, $ options );
4738 $ this ->slaveConnection = $ slaveConf
48- ? Engine::setConnection ($ name .'_slave ' , $ slaveConf )
39+ ? Engine::setConnection ($ name .'_slave ' , $ slaveConf, $ options )
4940 : null ;
5041 }
5142
0 commit comments