Beispiel #1
0
 /**
  * Returns a new QueryExpression object. This is a handy function when
  * building complex queries using a fluent interface. You can also override
  * this function in subclasses to use a more specialized QueryExpression class
  * if required.
  *
  * You can optionally pass a single raw SQL string or an array or expressions in
  * any format accepted by \Cake\Database\Expression\QueryExpression:
  *
  * ```
  *
  * $expression = $query->newExpr(); // Returns an empty expression object
  * $expression = $query->newExpr('Table.column = Table2.column'); // Return a raw SQL expression
  * ```
  *
  * @param mixed $rawExpression A string, array or anything you want wrapped in an expression object
  * @return QueryExpression
  */
 public function newExpr($rawExpression = null) : QueryExpression
 {
     $expression = new QueryExpression([], $this->typeMap());
     if ($rawExpression !== null) {
         $expression->add($rawExpression);
     }
     return $expression;
 }
 /**
  * Constructor
  *
  * @param array $conditions The sort columns
  * @param array $types The types for each column.
  * @param string $conjunction The glue used to join conditions together.
  */
 public function __construct($conditions = [], $types = [], $conjunction = '')
 {
     parent::__construct($conditions, $types, $conjunction);
 }