diff --git a/Cake/Database/Expression/QueryExpression.php b/Cake/Database/Expression/QueryExpression.php index 15902869962..b7bb4643f9d 100644 --- a/Cake/Database/Expression/QueryExpression.php +++ b/Cake/Database/Expression/QueryExpression.php @@ -266,6 +266,15 @@ public function notIn($field, $values, $type = null) { return $this->add([$field . ' NOT IN' => $values], $type ? [$field => $type] : []); } +/** + * Returns a new QueryExpresion object containing all the conditions passed + * and set up the conjunction to be "AND" + * + * @param string|array|QueryExpression $conditions to be joined with AND + * @param array $types associative array of fields pointing to the type of the + * values that are being passed. Used for correctly binding values to statements. + * @return \Cake\Database\Expression\QueryExpression + */ public function and_($conditions, $types = []) { if (is_callable($conditions)) { return $conditions(new self); @@ -273,6 +282,15 @@ public function and_($conditions, $types = []) { return new self($conditions, $types); } +/** + * Returns a new QueryExpresion object containing all the conditions passed + * and set up the conjunction to be "OR" + * + * @param string|array|QueryExpression $conditions to be joined with OR + * @param array $types associative array of fields pointing to the type of the + * values that are being passed. Used for correctly binding values to statements. + * @return \Cake\Database\Expression\QueryExpression + */ public function or_($conditions, $types = []) { if (is_callable($conditions)) { return $conditions(new self([], [], 'OR'));