@@ -62,7 +62,7 @@ public function loadConfiguration()
62
62
63
63
private function setupDatabase ($ config , $ name )
64
64
{
65
- $ container = $ this ->getContainerBuilder ();
65
+ $ builder = $ this ->getContainerBuilder ();
66
66
67
67
foreach ((array ) $ config ['options ' ] as $ key => $ value ) {
68
68
if (preg_match ('#^PDO::\w+\z# ' , $ key )) {
@@ -71,11 +71,11 @@ private function setupDatabase($config, $name)
71
71
}
72
72
}
73
73
74
- $ connection = $ container ->addDefinition ($ this ->prefix ("$ name.connection " ))
74
+ $ connection = $ builder ->addDefinition ($ this ->prefix ("$ name.connection " ))
75
75
->setClass (Nette \Database \Connection::class, [$ config ['dsn ' ], $ config ['user ' ], $ config ['password ' ], $ config ['options ' ]])
76
76
->setAutowired ($ config ['autowired ' ]);
77
77
78
- $ structure = $ container ->addDefinition ($ this ->prefix ("$ name.structure " ))
78
+ $ structure = $ builder ->addDefinition ($ this ->prefix ("$ name.structure " ))
79
79
->setClass (Nette \Database \Structure::class)
80
80
->setArguments ([$ connection ])
81
81
->setAutowired ($ config ['autowired ' ]);
@@ -94,7 +94,7 @@ private function setupDatabase($config, $name)
94
94
$ conventions = NULL ;
95
95
96
96
} elseif (is_string ($ config ['conventions ' ])) {
97
- $ conventions = $ container ->addDefinition ($ this ->prefix ("$ name. $ conventionsServiceName " ))
97
+ $ conventions = $ builder ->addDefinition ($ this ->prefix ("$ name. $ conventionsServiceName " ))
98
98
->setClass (preg_match ('#^[a-z]+\z#i ' , $ config ['conventions ' ])
99
99
? 'Nette\Database\Conventions \\' . ucfirst ($ config ['conventions ' ]) . 'Conventions '
100
100
: $ config ['conventions ' ])
@@ -106,7 +106,7 @@ private function setupDatabase($config, $name)
106
106
$ conventions = reset ($ tmp );
107
107
}
108
108
109
- $ container ->addDefinition ($ this ->prefix ("$ name.context " ))
109
+ $ builder ->addDefinition ($ this ->prefix ("$ name.context " ))
110
110
->setClass (Nette \Database \Context::class, [$ connection , $ structure , $ conventions ])
111
111
->setAutowired ($ config ['autowired ' ]);
112
112
@@ -120,9 +120,9 @@ private function setupDatabase($config, $name)
120
120
}
121
121
122
122
if ($ this ->name === 'database ' ) {
123
- $ container ->addAlias ($ this ->prefix ($ name ), $ this ->prefix ("$ name.connection " ));
124
- $ container ->addAlias ("nette.database. $ name " , $ this ->prefix ($ name ));
125
- $ container ->addAlias ("nette.database. $ name.context " , $ this ->prefix ("$ name.context " ));
123
+ $ builder ->addAlias ($ this ->prefix ($ name ), $ this ->prefix ("$ name.connection " ));
124
+ $ builder ->addAlias ("nette.database. $ name " , $ this ->prefix ($ name ));
125
+ $ builder ->addAlias ("nette.database. $ name.context " , $ this ->prefix ("$ name.context " ));
126
126
}
127
127
}
128
128
0 commit comments