Permalink
Browse files

add method for prepare SQL for tests

  • Loading branch information...
chemix committed Dec 14, 2014
1 parent f534c15 commit cee2a693c3992c542a7b7c8b314b6f471fbf7ada
Showing with 22 additions and 0 deletions.
  1. +22 −0 dibi/libs/DibiConnection.php
@@ -282,6 +282,28 @@ public static function alias(& $config, $key, $alias)
}
}
/**
* Generates and return SQL query.
* @param array|mixed one or more arguments
* @return string|FALSE
*/
final public function testQuery($args)
{
$args = func_get_args();
try {
return $this->translateArgs($args);
} catch (DibiException $e) {
if ($e->getSql()) {
dibi::dump($e->getSql());
} else {
echo get_class($e) . ': ' . $e->getMessage() . (PHP_SAPI === 'cli' ? "\n" : '<br>');
}
return FALSE;
}
}
/**
* Generates (translates) and returns SQL query as DibiDataSource.

0 comments on commit cee2a69

Please sign in to comment.