diff --git a/runtime/lib/query/ModelCriteria.php b/runtime/lib/query/ModelCriteria.php index e68c0836b..dddfc8212 100644 --- a/runtime/lib/query/ModelCriteria.php +++ b/runtime/lib/query/ModelCriteria.php @@ -525,18 +525,18 @@ public function offset($offset) */ public function select($columnArray) { - if (!count($columnArray) || $columnArray == '') { + if (empty($columnArray)) { throw new PropelException('You must ask for at least one column'); } - if ($columnArray == '*') { + if (is_string($columnArray) && $columnArray === '*') { $columnArray = array(); foreach (call_user_func(array($this->modelPeerName, 'getFieldNames'), BasePeer::TYPE_PHPNAME) as $column) { $columnArray[] = $this->modelName . '.' . $column; } } - $this->select = $columnArray; + $this->select = (array)$columnArray; return $this; }