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:
@@ -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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user