Skip to content

Commit

Permalink
Fix count() for PHP 7.2
Browse files Browse the repository at this point in the history
  • Loading branch information
gzumba committed Jan 27, 2020
1 parent 88f04d7 commit 1eeb9be
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions runtime/lib/query/ModelCriteria.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 1eeb9be

Please sign in to comment.