Removed deprecated function calls
Copied missing method from nette/database