Answer the question
In order to leave comments, you need to log in
(Yii2) Why is the result of $UserModelInstance->friends different from $UserModelInstance->getFriends()?
The user model has a getFriends() method
public function getFriends()
{
return $this->hasMany(static::className(), ['id' => 'id'])
->viaTable('{{%user_friends}}', ['friend_id' => 'id']);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question