1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-02 20:27:35 +02:00

DibiTranslator: object is initialized in constructor

This commit is contained in:
David Grudl
2014-03-24 18:59:50 +01:00
parent 4f64bd726b
commit 0071b80938

View File

@@ -51,6 +51,8 @@ final class DibiTranslator extends DibiObject
public function __construct(DibiConnection $connection)
{
$this->connection = $connection;
$this->driver = $connection->getDriver();
$this->identifiers = new DibiHashMap(array($this, 'delimite'));
}
@@ -62,9 +64,6 @@ final class DibiTranslator extends DibiObject
*/
public function translate(array $args)
{
$this->identifiers = new DibiHashMap(array($this, 'delimite'));
$this->driver = $this->connection->getDriver();
$args = array_values($args);
while (count($args) === 1 && is_array($args[0])) { // implicit array expansion
$args = array_values($args[0]);