| Conditions | 2 |
| Paths | 2 |
| Total Lines | 16 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 17 | public function __construct($connectionName = 'default') |
||
| 18 | {
|
||
| 19 | $connections = Configuration::getInstance()->get('connections');
|
||
| 20 | |||
| 21 | if (!array_key_exists($connectionName, $connections)) {
|
||
| 22 | throw new Exception("Connection '$connectionName' is not found in .settings.php");
|
||
| 23 | } |
||
| 24 | |||
| 25 | $connection = $connections[$connectionName]; |
||
| 26 | |||
| 27 | parent::__construct( |
||
| 28 | "mysql:dbname={$connection['database']};host={$connection['host']}",
|
||
| 29 | $connection['login'], |
||
| 30 | $connection['password'] |
||
| 31 | ); |
||
| 32 | } |
||
| 33 | } |
||
| 34 |