title: Yii two-level "with" in Relational Active Record
body: <p>I have three tables: </p>
  
  <ol>
  <li><code>tbl_tag</code></li>
  <li><code>tbl_post</code></li>
  <li><code>tbl_post_tag(post_id, tag_id)</code></li>
  <li><code>tbl_users</code>.</li>
  </ol>
  
  <p>Each Post has multiple Tags and each Tag has multiple Posts. (MANY_MANY)</p>
  
  <p>Each Post has only one User and each User has multiple Posts. </p>
  
  <p>I use <code>tbl_post_tag</code> to record the relations between Post and Tag.</p>
  
  <p>Now I'd like to retrieve all the Posts by tag_id (like show all posts and corresponding user with tag_id = 1)</p>
  
  <p>I really don't know how to do this. </p>
  
  <p>My guess is to use <code>Tag::model()-&gt;with("post")-&gt;findByPk(1)</code>, but does this retrieve Users at the same time?</p>
  
  <p>Or is there any better way to do this job? </p>
  
  <p>Thanks!</p>