Answer the question
In order to leave comments, you need to log in
How to link models through a linked table?
You need to select
an article, and with it all its authors (there can be > 1)
. Thanks in advance
Answer the question
In order to leave comments, you need to log in
with grief on the floor
public function getAuthors(){
return $this->hasMany(\app\models\Profile::className(), ['user_id'=>'id_author'])
->viaTable(\app\models\MaterialJoinAuthor::tableName(),['id_material' => 'id_material']);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question