From faaff8989c03afb0876f857949e47208b3406cc7 Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Sat, 1 Dec 2012 18:38:05 +0400 Subject: [PATCH] better conversion to array --- framework/db/dao/QueryBuilder.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/framework/db/dao/QueryBuilder.php b/framework/db/dao/QueryBuilder.php index bc5845a..187b265 100644 --- a/framework/db/dao/QueryBuilder.php +++ b/framework/db/dao/QueryBuilder.php @@ -566,9 +566,7 @@ class QueryBuilder extends \yii\base\Object list($column, $values) = $operands; - if (!is_array($values)) { - $values = array($values); - } + $values = (array)$values; if ($values === array()) { return $operator === 'in' ? '0=1' : ''; @@ -594,9 +592,7 @@ class QueryBuilder extends \yii\base\Object list($column, $values) = $operands; - if (!is_array($values)) { - $values = array($values); - } + $values = (array)$values; if ($values === array()) { return $operator === 'like' || $operator === 'or like' ? '0=1' : '';