Skip to content

Commit 1eeb9be

Browse files
committed
Fix count() for PHP 7.2
1 parent 88f04d7 commit 1eeb9be

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

runtime/lib/query/ModelCriteria.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -525,18 +525,18 @@ public function offset($offset)
525525
*/
526526
public function select($columnArray)
527527
{
528-
if (!count($columnArray) || $columnArray == '') {
528+
if (empty($columnArray)) {
529529
throw new PropelException('You must ask for at least one column');
530530
}
531531

532-
if ($columnArray == '*') {
532+
if (is_string($columnArray) && $columnArray === '*') {
533533
$columnArray = array();
534534
foreach (call_user_func(array($this->modelPeerName, 'getFieldNames'), BasePeer::TYPE_PHPNAME) as $column) {
535535
$columnArray[] = $this->modelName . '.' . $column;
536536
}
537537
}
538538

539-
$this->select = $columnArray;
539+
$this->select = (array)$columnArray;
540540

541541
return $this;
542542
}

0 commit comments

Comments
 (0)