mirror of
https://github.com/dg/dibi.git
synced 2025-08-05 13:47:33 +02:00
DibiConnection::sql() renamed to verb translate()
This commit is contained in:
@@ -260,7 +260,7 @@ class DibiConnection extends DibiObject
|
||||
* @return string
|
||||
* @throws DibiException
|
||||
*/
|
||||
final public function sql($args)
|
||||
final public function translate($args)
|
||||
{
|
||||
$this->connected || $this->connect();
|
||||
$args = func_get_args();
|
||||
@@ -269,6 +269,17 @@ class DibiConnection extends DibiObject
|
||||
|
||||
|
||||
|
||||
/** @deprecated */
|
||||
function sql($args)
|
||||
{
|
||||
trigger_error(__METHOD__ . '() is deprecated; use translate() instead.', E_USER_NOTICE);
|
||||
$this->connected || $this->connect();
|
||||
$args = func_get_args();
|
||||
return $this->translator->translate($args);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Generates and prints SQL query.
|
||||
* @param array|mixed one or more arguments
|
||||
|
@@ -286,7 +286,7 @@ class DibiDataSource extends DibiObject implements IDataSource
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return $this->connection->sql('
|
||||
return $this->connection->translate('
|
||||
SELECT %n', (empty($this->cols) ? '*' : $this->cols), '
|
||||
FROM %SQL', $this->sql, '
|
||||
%ex', $this->conds ? array('WHERE %and', $this->conds) : NULL, '
|
||||
|
@@ -422,7 +422,7 @@ class DibiFluent extends DibiObject implements IDataSource
|
||||
*/
|
||||
public function toDataSource()
|
||||
{
|
||||
return new DibiDataSource($this->connection->sql($this->_export()), $this->connection);
|
||||
return new DibiDataSource($this->connection->translate($this->_export()), $this->connection);
|
||||
}
|
||||
|
||||
|
||||
@@ -433,7 +433,7 @@ class DibiFluent extends DibiObject implements IDataSource
|
||||
*/
|
||||
final public function __toString()
|
||||
{
|
||||
return $this->connection->sql($this->_export());
|
||||
return $this->connection->translate($this->_export());
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user