title: Yii Model - MANY_MANY relations - do I still need a HAS_MANY?
body: <p>I am defining the many to many relationship between two objects (ModelA &amp; ModelB for this example) through three tables/active record models in the following way:</p>
  
  <p>ModelA --&lt; ModelA_B >-- ModelB</p>
  
  <p>Where ModelA_B contains a foreign key field to both ModelA and ModelB. So in the code for ModelA I have have added to the <strong>relations()</strong> function:</p>
  
  <pre><code>'modelbs' =&gt; array(self::MANY_MANY, 'ModelB', 'tbl_modelb(modela_id,modelb_id)'),
  </code></pre>
  
  <p>My question is do I still need the HAS_MANY relationship that was generated by Gii to represent the relation to the linking table ModelA_B or is this declared implicitly by the MANY_MANY above? </p>
  
  <pre><code>'modelabs' =&gt; array(self::HAS_MANY, 'ModelA_B', 'ModelA_Id'),
  </code></pre>