|
|
@@ -293,7 +293,7 @@ class QueryExpression implements ExpressionInterface, Countable {
|
|
|
* @return \Cake\Database\Expression\QueryExpression
|
|
|
*/
|
|
|
public function and_($conditions, $types = []) {
|
|
|
- if (is_callable($conditions)) {
|
|
|
+ if (!is_string($conditions) && is_callable($conditions)) {
|
|
|
return $conditions(new self([], $this->typeMap()->types($types)));
|
|
|
}
|
|
|
return new self($conditions, $this->typeMap()->types($types));
|
|
|
@@ -309,7 +309,7 @@ class QueryExpression implements ExpressionInterface, Countable {
|
|
|
* @return \Cake\Database\Expression\QueryExpression
|
|
|
*/
|
|
|
public function or_($conditions, $types = []) {
|
|
|
- if (is_callable($conditions)) {
|
|
|
+ if (!is_string($conditions) && is_callable($conditions)) {
|
|
|
return $conditions(new self([], $this->typeMap()->types($types), 'OR'));
|
|
|
}
|
|
|
return new self($conditions, $this->typeMap()->types($types), 'OR');
|
|
|
@@ -434,7 +434,7 @@ class QueryExpression implements ExpressionInterface, Countable {
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
- if (is_callable($c)) {
|
|
|
+ if (!is_string($c) && is_callable($c)) {
|
|
|
$expr = new QueryExpression([], $typeMap);
|
|
|
$c = $c($expr, $this);
|
|
|
}
|