title: Symfony2 Doctrine2 get result using criteria with second relation
body: <p>I would like to ask Is there any simple method to get data with conditions in second relation.</p>
  <p>In my controller I get every category entity.</p>
  <p>Every category have many products so there is relation &quot;OneToMany&quot;.
  Next every product have an author and there is relation &quot;ManyToOne&quot;.</p>
  <p>Now I would like to get every category which include products whose are active and whose author is active.</p>
  <p>category OneToMany product
  product ManyToOne author
  product have field &quot;active&quot;
  author have field &quot;active&quot;</p>
  <p>My method to get products in Category entity.</p>
  <pre><code>public function getProducts()
  {
      $criteria = Criteria::create();
      $criteria-&gt;where(Criteria::expr()-&gt;eq('isVisible', true));
      $criteria-&gt;andWhere(Criteria::expr()-&gt;eq('isActive', true));
      
      return $this-&gt;products-&gt;matching($criteria);
  }
  </code></pre>