Answer the question
In order to leave comments, you need to log in
Yii2: has many on self. Why does looping happen?
There is a table of users. Each user can have a leader
id, leader_id and blah blah blah
I want to display all users whose leader I am
public function getTeam(){
return $this->hasMany(self::className(), ['leader_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