how to DI inject another database connection to component

mcmatak
Member | 500
+
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 | 6233
+
+1
-
-
	implement: App\Components\IUserControlFactory
	arguments: [@database.default.context]
mcmatak
Member | 500
+
0
-

perfect thanks