Skip to content

Commit

Permalink
Adding missing doc blocks to QueryExpression
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Jan 5, 2014
1 parent 51fa76c commit 0aa6bdb
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Cake/Database/Expression/QueryExpression.php
Expand Up @@ -266,13 +266,31 @@ 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);
}
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'));
Expand Down

0 comments on commit 0aa6bdb

Please sign in to comment.