title: use Joins for multiple tables in yii2
body: <p>I am using yii2, I have 3 tables: posts, fans, comments and i want to use joinWith() to get the posts with their comments and the fan name (in fans table) for post and comments.
  what i wrote is this query:</p>
  
  <pre><code>&lt;pre&gt;
   facebook_posts::find()-&gt;joinwith('fans')-&gt;joinWith('comments')-&gt;all();
  &lt;/pre&gt;
  </code></pre>
  
  <p>and I added these two functions for the relations:</p>
  
  <pre><code>&lt;pre&gt;
      public function getfans() {
          return $this-&gt;hasOne(Fans::className(), ['id' =&gt; 'from_id'])-&gt;from(fans::tableName() . ' FBF');
      }
      public function getComments() {
          return $this-&gt;hasMany(Comments::className(), ['parent_id' =&gt; 'id'])-&gt;from(comments::tableName() . ' FBC');
      }
  &lt;/pre&gt;
  </code></pre>
  
  <p>this gives me the posts and the data of the fan who wrote the post and its comments but what i need is the data of fan that wrote the comments also, so how can i join comments with fans table ??</p>