{
"name": "Unknown Property",
"message": "Getting unknown property: common\\models\\user\\User::rating",
"code": 0,
"type": "yii\\base\\UnknownPropertyException",
"file": "/web/yii2/vendor/yiisoft/yii2/base/Component.php",
"line": 154,
"stack-trace": [
"#0 /web/yii2/vendor/yiisoft/yii2/db/BaseActiveRecord.php(298): yii\\base\\Component->__get('rating')",
"#1 /web/yii2/vendor/yiisoft/yii2/base/ArrayableTrait.php(126): yii\\db\\BaseActiveRecord->__get('rating')",
"#2 /web/yii2/vendor/yiisoft/yii2/rest/Serializer.php(260): yii\\base\\Model->toArray(Array, Array)",
"#3 /web/yii2/vendor/yiisoft/yii2/rest/Serializer.php(150): yii\\rest\\Serializer->serializeModel(Object(common\\models\\user\\User))",
"#4 /web/yii2/vendor/yiisoft/yii2/rest/Controller.php(99): yii\\rest\\Serializer->serialize(Object(common\\models\\user\\User))",
"#5 /web/yii2/vendor/yiisoft/yii2/rest/Controller.php(77): yii\\rest\\Controller->serializeData(Object(common\\models\\user\\User))",
"#6 /web/yii2/vendor/yiisoft/yii2/base/Controller.php(159): yii\\rest\\Controller->afterAction(Object(yii\\base\\InlineAction), Object(common\\models\\user\\User))",
"#7 /web/yii2/vendor/yiisoft/yii2/base/Module.php(528): yii\\base\\Controller->runAction('wall', Array)",
"#8 /web/yii2/vendor/yiisoft/yii2/web/Application.php(103): yii\\base\\Module->runAction('v1/user/wall', Array)",
"#9 /web/yii2/vendor/yiisoft/yii2/base/Application.php(386): yii\\web\\Application->handleRequest(Object(yii\\web\\Request))",
"#10 /web/yii2/api/web/index.php(17): yii\\base\\Application->run()",
"#11 {main}"
]
}
public function actionWall($login){
$user = Yii::$app->user;
$user = User::find()->where(['username' => $login])->with([ 'person'])->one();
if ($user) {
return $user;
}
throw new NotFoundHttpException(Yii::t('app', 'The requested user does not exist.'));
}