Calling a database view in Yii using Active Record

后端 未结 2 2005
情深已故
情深已故 2020-12-20 17:11

I understand how to query a table with Yii\'s active record environment. I can\'t find documentation for calling a mysql view. Also, I know how to model a table in active

2条回答
  •  情深已故
    2020-12-20 17:33

    It should work fine in the same way as with tables. Just use the view name when you generate the model.

    Please read Joshua's answer and learn how to add primary Key into the OOP model for views.

提交回复
热议问题