A
A
akula222017-03-15 21:50:22
Yii
akula22, 2017-03-15 21:50:22

Is it possible to display two IDs through one relations?

Is it possible to do this with one relay, or do I need to do two?
the user table has id fields, username
the game table has user1 and user2 fields where user IDs are stored,
it must be displayed in the grid through relaying, the question is whether this can be done through

public function getUser()
    {
        return $this->hasOne(User::className(), ['id' => 'user_id']);
    }

Or do I need to make two relays user_id1 and user_id2
?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question