Hi all,
I have a model called Account() , it has a function called getPostsAccounts(); it returns all account data left join with a table called post_accounts bellow is a part of the code:
public function getPostAccounts(){
return \backend\models\Accounts::find()->joinWith('posts')->all();
}
this is the relation function
public function getPosts(){
return $this->hasOne(post_accounts::className(), ['account_id'=>'id']);
}
what i always get is this error:
Getting unknown property: backend\models\Accounts::
can anyone help me?