how to DI inject another database connection to component

Notice: This thread is very old.
mcmatak
Member | 504
+
0
-

how to do something like this?

in config.neon?

		- App\Components\IUserControlFactory(@database.default.context)

this would not work

public function createComponentUser($name)
       {
           $factory = $this->getContext()->getByType(IUserControlFactory::class);

in this case the $factory will by type of Nette\Database\Context not UserControl

David Matějka
Moderator | 6445
+
+1
-
-
	implement: App\Components\IUserControlFactory
	arguments: [@database.default.context]
mcmatak
Member | 504
+
0
-

perfect thanks