title: doctrine findby relation
body: <p>I'm having trouble selecting a subset of data with doctrine.</p>
  
  <p>I have 3 tables</p>
  
  <p>Location
  Contact
  Contact_location</p>
  
  <p>The contact and location tables hold a name and an id the other table holds only ID's. For instance:</p>
  
  <pre><code>Location
   loc_id: 1
   name: detroit
  Contact
   contact_id: 1
   name: Mike
  Contact_location
   loc_id: 1
   contact_id: 1
  </code></pre>
  
  <p>In doctrine there is a many to many relation between the location and contact tables with contact_location as the ref_class.</p>
  
  <p>What i want to do is on my location page i want to find all contacts where for instance the loc_id = 1.</p>
  
  <p>I tried:</p>
  
  <pre><code> $this-&gt;installedbases = Doctrine::getTable('contact')-&gt;findByloc_id(1);
  </code></pre>
  
  <p>hoping doctrine would see the relation and get it, but it does not.</p>
  
  <p>How can i make doctrine search in relevant related tables? I read it can be done using Findby but i find the documentation unclear.</p>