@@ -62,7 +62,7 @@ public function loadConfiguration()
6262
6363 private function setupDatabase ($ config , $ name )
6464 {
65- $ container = $ this ->getContainerBuilder ();
65+ $ builder = $ this ->getContainerBuilder ();
6666
6767 foreach ((array ) $ config ['options ' ] as $ key => $ value ) {
6868 if (preg_match ('#^PDO::\w+\z# ' , $ key )) {
@@ -71,11 +71,11 @@ private function setupDatabase($config, $name)
7171 }
7272 }
7373
74- $ connection = $ container ->addDefinition ($ this ->prefix ("$ name.connection " ))
74+ $ connection = $ builder ->addDefinition ($ this ->prefix ("$ name.connection " ))
7575 ->setClass (Nette \Database \Connection::class, [$ config ['dsn ' ], $ config ['user ' ], $ config ['password ' ], $ config ['options ' ]])
7676 ->setAutowired ($ config ['autowired ' ]);
7777
78- $ structure = $ container ->addDefinition ($ this ->prefix ("$ name.structure " ))
78+ $ structure = $ builder ->addDefinition ($ this ->prefix ("$ name.structure " ))
7979 ->setClass (Nette \Database \Structure::class)
8080 ->setArguments ([$ connection ])
8181 ->setAutowired ($ config ['autowired ' ]);
@@ -94,7 +94,7 @@ private function setupDatabase($config, $name)
9494 $ conventions = NULL ;
9595
9696 } elseif (is_string ($ config ['conventions ' ])) {
97- $ conventions = $ container ->addDefinition ($ this ->prefix ("$ name. $ conventionsServiceName " ))
97+ $ conventions = $ builder ->addDefinition ($ this ->prefix ("$ name. $ conventionsServiceName " ))
9898 ->setClass (preg_match ('#^[a-z]+\z#i ' , $ config ['conventions ' ])
9999 ? 'Nette\Database\Conventions \\' . ucfirst ($ config ['conventions ' ]) . 'Conventions '
100100 : $ config ['conventions ' ])
@@ -106,7 +106,7 @@ private function setupDatabase($config, $name)
106106 $ conventions = reset ($ tmp );
107107 }
108108
109- $ container ->addDefinition ($ this ->prefix ("$ name.context " ))
109+ $ builder ->addDefinition ($ this ->prefix ("$ name.context " ))
110110 ->setClass (Nette \Database \Context::class, [$ connection , $ structure , $ conventions ])
111111 ->setAutowired ($ config ['autowired ' ]);
112112
@@ -120,9 +120,9 @@ private function setupDatabase($config, $name)
120120 }
121121
122122 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 " ));
126126 }
127127 }
128128
0 commit comments