title: red bean php find by relation
body: <p>This seems like a simple question, but I'm somehow baffled. </p>
  
  <p>If I create a couple of beans with:</p>
  
  <pre><code>list($product1, $product2, $product3) = R::dispense('product', 3);
  ...
  </code></pre>
  
  <p>and a couple of categories with:</p>
  
  <pre><code>list($cat1, $cat2) = R::dispense('category', 2);
  ...
  </code></pre>
  
  <p>then link them with:</p>
  
  <pre><code>$product1-&gt;sharedCategory[] = $cat1;
  $product3-&gt;sharedCategory[] = $cat1;
  </code></pre>
  
  <p>how do I then query all products that are related to $cat1? I should get back product 1 and 3. </p>
  
  <p>Like I said, simple. In mysql this is a no-brainer, so could always just send red bean an sql string, but there must be a way of doing this built it, surely. </p>
  
  <p>Thanks.</p>