public function expr($expression, $binds = null) { $e = SimpleExpression::createFromFuncArguments(func_get_args()); return $e; }
/** * @param $expression * @param null $binds * @return SimpleExpression * @throws Sql\Exception */ public function expr($expression = null, $binds = null) { return SimpleExpression::createFromFuncArguments(func_get_args())->bindDatabase($this); }
public function prependExpr($expression) { array_unshift($this->queue, array(self::OP_APPEND, SimpleExpression::createFromFuncArguments(func_get_args()))); return $this; }
public function set($expression, $binds = null) { if (null === $expression) { return $this; } if (is_array($expression)) { $expressionString = ''; $bindsArray = array(); if (is_string($binds)) { $table = $binds; } else { $table = null; } foreach ($expression as $key => $value) { $expressionString .= '? = ?, '; $bindsArray[] = new Symbol($table, $key); $bindsArray[] = $value; } $expressionString = substr($expressionString, 0, -2); $expression = new SimpleExpression($expressionString, $bindsArray); } else { $expression = SimpleExpression::createFromFuncArguments(func_get_args()); } if (null === $this->set) { $this->set = $expression; } else { $this->set->commaExpr($expression); } return $this; }