How can I use own Database\Context class?

Notice: This thread is very old.
Member | 35

Hi, I need to extend Nette\Database\Context's transaction methods.
I've written my own class which extends from Nette\Database\Context and overrite these methods.

But I have no idea how to force Nette to use this class instead of original Nette\Database\Context. I've looked at Nette code and there is:

$connection = $container->addDefinition($this->prefix("database.$name"))
				->setClass('Nette\Database\Connection', array($info['dsn'], $info['user'], $info['password'], $info['options']))
				->addSetup('setContext', array(
					new Nette\DI\Statement('Nette\Database\Context', array('@self', $reflection)),
				->addSetup('Nette\Diagnostics\Debugger::getBlueScreen()->addPanel(?)', array(

				->setFactory(array($connection, 'getContext'))

What means I cannot specify Context class in config.neon?

What is the solution for this?

Thanks a lot!

Member | 35

Sorry for stupid question, this sorted it out :)

	class: MyNamespace\Context