Skip to content

Commit

Permalink
Fix binary expression deflate with argument array
Browse files Browse the repository at this point in the history
  • Loading branch information
c9s committed Sep 23, 2015
1 parent 3ac2382 commit d409623
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/SQLBuilder/Universal/Expr/BinaryExpr.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function __construct($operand, $op, $operand2) {
}

public function toSql(BaseDriver $driver, ArgumentArray $args) {
return $this->operand . ' ' . $this->op . ' ' . $driver->deflate($this->operand2);
return $this->operand . ' ' . $this->op . ' ' . $driver->deflate($this->operand2, $args);
}

static public function __set_state($array)
Expand Down
8 changes: 5 additions & 3 deletions src/SQLBuilder/Universal/Expr/UnaryExpr.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@ class UnaryExpr implements ToSqlInterface

public $operand;

public function __construct($op, $operand) {
public function __construct($op, $operand)
{
$this->op = $op;
$this->operand = $operand;
}

public function toSql(BaseDriver $driver, ArgumentArray $args) {
return $this->op . ' ' . $this->operand;
public function toSql(BaseDriver $driver, ArgumentArray $args)
{
return $this->op . ' ' . $driver->deflate($this->operand, $args);
}

static public function __set_state(array $array)
Expand Down

0 comments on commit d409623

Please sign in to comment.