1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-06 22:26:43 +02:00

Connection::translateArg() removed (BC break)

This commit is contained in:
David Grudl
2018-05-07 22:38:13 +02:00
parent f4e71e8855
commit decb30de1e

View File

@@ -200,7 +200,7 @@ class Connection implements IConnection
*/ */
final public function query(...$args): Result final public function query(...$args): Result
{ {
return $this->nativeQuery($this->translateArgs($args)); return $this->nativeQuery($this->translate(...$args));
} }
@@ -211,7 +211,10 @@ class Connection implements IConnection
*/ */
final public function translate(...$args): string final public function translate(...$args): string
{ {
return $this->translateArgs($args); if (!$this->driver) {
$this->connect();
}
return (clone $this->translator)->translate($args);
} }
@@ -222,7 +225,7 @@ class Connection implements IConnection
final public function test(...$args): bool final public function test(...$args): bool
{ {
try { try {
Helpers::dump($this->translateArgs($args)); Helpers::dump($this->translate(...$args));
return true; return true;
} catch (Exception $e) { } catch (Exception $e) {
@@ -243,19 +246,7 @@ class Connection implements IConnection
*/ */
final public function dataSource(...$args): DataSource final public function dataSource(...$args): DataSource
{ {
return new DataSource($this->translateArgs($args), $this); return new DataSource($this->translate(...$args), $this);
}
/**
* Generates SQL query.
*/
protected function translateArgs(array $args): string
{
if (!$this->driver) {
$this->connect();
}
return (clone $this->translator)->translate($args);
} }