Rectangle 27 0

php Calling a database view in Yii using Active Record?


app\\models\\db\\WarComplete must have a primary key.
public static function primaryKey()
{
    return ['id'];
}

I am not having the same experience and this comment is for those who are having trouble.

Using a mysql view with some joins and calculations I get the following error..

Note
Rectangle 27 0

php Calling a database view in Yii using Active Record?


Sign up for our newsletter and get our top new questions delivered to your inbox (see an example).

Note
Rectangle 27 0

php Calling a database view in Yii using Active Record?


@open-ecommerce.org just because Joshua completed 4 years later the answer, and Yii versions have been updated.

Not sure why this answer it is marked as correct and has 7 because the active model needs a primary key to work by design and you won't have it in a db you can try the Joshua tip though

Note
Rectangle 27 0

php Calling a database view in Yii using Active Record?


app\\models\\db\\WarComplete must have a primary key.
public static function primaryKey()
{
    return ['id'];
}

I am not having the same experience and this comment is for those who are having trouble.

Using a mysql view with some joins and calculations I get the following error..

Note