From 1eeb9be89c80be59dae39dc2f5c2d317e443b792 Mon Sep 17 00:00:00 2001 From: zumba Date: Fri, 12 Jan 2018 19:14:48 +0200 Subject: [PATCH] Fix count() for PHP 7.2 --- runtime/lib/query/ModelCriteria.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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; }