nvlad / yii2support

Yii2 Support for PhpStorm / IntelliJ IDEA
https://plugins.jetbrains.com/idea/plugin/9388-yii2-support
Other
295 stars 54 forks source link

Yii2 - Query insert Hightlight error "field 'user_id' not exists in referenced class" in insert arguments #201

Open Sect0R opened 6 years ago

Sect0R commented 6 years ago

What steps will reproduce the problem?

create simple database request 3.\Yii::$app->db->createCommand()->insert('table', ['user_id' => 1])->execute();

What do you get instead?

Highlight error "field 'user_id' not exists in referenced class" in insert arguments xtafxtv

Additional info

Q A
IDE Name PhpStorm
IDE Version 2018.1.4
Plugin version 0.9.54.9
Yii App Template basic
Mitchell64 commented 4 years ago

I see the same issue.

Yii::$app->db->createCommand()->insert('user', ['type' => 'Admin'])->execute();

The above line of code shows error: "Field 'type' not exists in referenced class \yii\db\Query"

zulicheg commented 4 years ago

I see the same issue. PhpStorm 2020.2, plugin 0.10.57.23

Ziggizag commented 3 years ago

Abandonware?

puppet-king commented 1 year ago

Because the code here is “@param array|Query"

You can modify it to

            $insertColumns = [
                'user_id' => 5
            ];
            $data = Yii::$app->db->createCommand()->insert(self::tableName(), $insertColumns)->execute();

image

uzdevid commented 1 year ago

Field 'message.create_time' not exists in referenced class \yii\db\ExpressionInterface

image

puppet-king commented 1 year ago

谢谢