private function _getValues($values) { $returnStr = ""; foreach ($values as $value) { $returnStr .= Expr::quoteLiteral($value) . ","; } return trim($returnStr, ","); }
public function __toString() { $leftExpr = Expr::quoteLiteral($this->_leftExpr); $rightExpr = Expr::quoteLiteral($this->_rightExpr); if ($leftExpr instanceof Math or $leftExpr instanceof QueryBuilder) { $leftExpr = '(' . $leftExpr . ')'; } if ($rightExpr instanceof Math or $rightExpr instanceof QueryBuilder) { $rightExpr = '(' . $rightExpr . ')'; } return $leftExpr . ' ' . $this->_operator . ' ' . $rightExpr; }
public function __toString() { $finalArguments = $this->_arguments; foreach ($finalArguments as &$arg) { $arg = Expr::quoteLiteral($arg); } $returnStr = $this->_name . '(' . implode(', ', $finalArguments) . ')'; if ($this->_alias != null) { $returnStr .= " as `" . $this->_alias . "`"; } return $returnStr; }
public function __toString() { // Adjusting Left Expression $leftExpr = (string) Expr::quoteLiteral($this->_leftExpr); if ($this->_leftExpr instanceof Math) { $leftExpr = '(' . $leftExpr . ')'; } // Adjusting Right Expression $rightExpr = (string) Expr::quoteLiteral($this->_rightExpr); if ($this->_rightExpr instanceof Math) { $rightExpr = '(' . $rightExpr . ')'; } return $leftExpr . ' ' . $this->_operator . ' ' . $rightExpr; }
/** * Creates an instance of BETWEEN() function, with the given argument. * * @param mixed $val Valued to be inspected by range values. * @param integer $x Starting range value to be used in BETWEEN() function. * @param integer $y End point value to be used in BETWEEN() function. * @return Func A BETWEEN expression. */ public function between($val, $x, $y) { return Expr::quoteLiteral($val) . ' BETWEEN ' . Expr::quoteLiteral($x) . ' AND ' . Expr::quoteLiteral($y); }