Skip to content

Commit cea354d

Browse files
committed
Fix count() for PHP 7.2
1 parent 3f7a284 commit cea354d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"repositories": [
2929
{
3030
"type": "pear",
31-
"url": "http://pear.php.net"
31+
"url": "https://pear.php.net"
3232
}
3333
],
3434
"bin": ["generator/bin/propel-gen", "generator/bin/propel-gen.bat"]

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)