| 1 | <?php |
||
| 12 | class User extends Model |
||
| 13 | { |
||
| 14 | public $id; |
||
| 15 | public $username; |
||
| 16 | public $email; |
||
| 17 | public $status; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * @inheritdoc |
||
| 21 | */ |
||
| 22 | public function rules() |
||
| 29 | |||
| 30 | /** |
||
| 31 | * Creates data provider instance with search query applied |
||
| 32 | * |
||
| 33 | * @param array $params |
||
| 34 | * |
||
| 35 | * @return ActiveDataProvider |
||
| 36 | */ |
||
| 37 | public function search($params) |
||
| 63 | } |
||
| 64 |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: