public function hookTransactions (Resource\Db &$parent, Resource\Db &$child = NULL)
	{
		
		// Use default object database resource if none is specified
		
		if (!$child)
		{
			$child	=& $this->getResource ('db');
		}
		
		/**
		 * We only want to create the hook and begin a transaction on the database
		 * if a transaction has already begun on the database we're hooking onto.
		 */
		
		if ($parent->getTransactionCount () > 0 && $parent->addTransactionHook ($child))
		{
			$child->beginTransaction ();
		}
		
	}
public function hookTransactions (Resource\Db &$parent, Resource\Db &$child = NULL)
	{
		
		// Use default object database resource if none is specified
		
		if (!$child)
		{
			$child	=& $this->getResource ('db');
		}
		
		/**
		 * We only want to create the hook and begin a transaction on the database
		 * if a transaction has already begun on the database we're hooking onto.
		 */
		
		if ($parent->getTransactionCount () > 0 && $parent->addTransactionHook ($child))
		{
			$child->beginTransaction ();
		}
		
	}
public function hookTransactions ( Resource \ Db & $ parent , Resource \ Db & $ child = NULL ) { // Use default object database resource if none is specified if ( ! $ child ) { $ child = & $ this -> getResource ( 'db' ) ; } /**
		 * We only want to create the hook and begin a transaction on the database
		 * if a transaction has already begun on the database we're hooking onto.
		 */ if ( $ parent -> getTransactionCount ( ) > 0 && $ parent -> addTransactionHook ( $ child ) ) { $ child -> beginTransaction ( ) ; } }
Hook any database queries into another database transaction
so that the queries are commited and rolled back at the same point
@param \Sonic\Resource\Db $parent Parent database
This is the database resource that is hooked and passes transaction state to the child database
@param \Sonic\Resource\Db $child Child database
This is the datababase resource that hooks onto the parent and has its transaction state copied from the parent
Defaults to object 'db' connection resource
Hook any database queries into another database transaction so that the queries are commited and rolled back at the same point