Welcome Guest, Not a member yet? Register   Sign In
groupBy() undefined in Model.php
#1

hello

in my model i use
PHP Code:
$this->select('.....')
     ->join('.....','left')
    ->groupBy('.....'); 
phpstan return an error
Code:
Call to an undefined method App\Models\MyModel::groupBy()
maybe this line
PHP Code:
* @method $this groupBy($by, ?bool $escape null
will be added in the Model.php in codeigniter folder ?
Reply
#2

phpstan errors can be tricky to diagnose with the code you provided. Can you provide additional context as to how and where you are calling this method. Also, it would be best to include your entire model file, so we can see any 'use' statements, and to see any defined class properties.
Reply
#3

(This post was last modified: 08-27-2022, 03:19 AM by kenjis.)

@paul That's right. I sent a PR https://github.com/codeigniter4/CodeIgniter4/pull/6433

Fixed. The fix will be included in v4.2.5.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB