- Member | 6
is there any reason why class ‘Nette\Database\Connection’ is hard-wired into NetteExtension?
I'd like to use my own descendant of that class, but I'm not able to change used class in config.neon.
I expected that if I use following definition I'll get object of specified class:
<?php nette: database: default: class: \MyDatabase\Class ?>
- Moderator | 4693
No, you won't. You'd have to change class of the service. That part you're trying si parameters for extensions.
services: nette.database.default: class: MyDatabase\MyClass
But after this, makes no sense for you to let Nette configure NDB, because
you'd have to pass the parameters “by hand”. So just create new configured
service, and don't configure the section in
services: connection: class: MyDatabase\MyClass("host=localhost;...", ...)