title: Yii2 viaTable join condition
body: <p>Is it possible to set condition in join section in viaTable?
  Currently I got this:</p>
  
  <pre><code>return $this-&gt;hasMany(User::className(), ['id' =&gt; 'id_user'])
                      -&gt;from(User::tableName())
                      -&gt;viaTable(RoomActiveUser::tableName(), ['id_room' =&gt; 'id'],
                          function($query) {
                          return $query-&gt;andWhere(['id_role' =&gt; 
                                   RoleHelper::getConsultantRole()-&gt;id]);
                      });
  </code></pre>
  
  <p>But it's not a good solution. Why? 
  When you do a left join the <code>id_role</code> condition will make it inner join actually. The <code>id_role</code> condition should be placed inside <code>ON</code> section of the join.</p>
  
  <p>I was searching the web plus inspecting the code but I don't see how it could be solved.</p>