title: extbase query builder injection of one repository to another repository
body: <p>I have a question regarding extbase if I need to inject a reposotory into another reposotry for getting join condition in the query what I need to do for that?</p>
  
  <p>For example this query  </p>
  
  <pre><code>     $query = $this-&gt;createQuery()
        -&gt;statement('
             SELECT tx_casmarketing_domain_model_category.uid, tx_casmarketing_domain_model_category.name
             FROM tx_casmarketing_domain_model_category, tx_casmarketing_domain_model_ad
             WHERE tx_casmarketing_domain_model_ad.ad_cat = tx_casmarketing_domain_model_category.uid ')
  </code></pre>
  
  <p>This query I am trying to access through </p>
  
  <pre><code>  $query = $this-&gt;createQuery();
         $query-&gt;matching(
                 );
  </code></pre>
  
  <p>Basically I am trying to inject one ad repository to category repository because there is no relationship defined in model for that.</p>
  
  <p>my model contain category to ads relationship so when i access ads throughs adRepository I automcally accesss the cateogrys along with adCategory Repository, but in vise-virsa when i need category which has been selected for the ads i can only access through joining in query becus i do not have that relationship in my model. i need that category for my doropdown list in ads that how many ads category corrently ads contain...</p>
  
  <p>this->adrepository->findAll() i automcally access ads with selected  cateogry because this relationship already exist in my model but i need some how $this->categoryRepository($this->adrepository->finAll())</p>
  
  <p>in drop down list i need only that category which is currently active. I can access this through simple query like i mention above but i need it through extbase query stuff becuse with extbase query way i can use buitin functionaly of typo3 like time stamp for start and end and hidden builtin functionality i want</p>
  
  <pre><code>  -&gt;statement('
        SELECT tx_casmarketing_domain_model_category.uid,      tx_casmarketing_domain_model_category.name
            FROM tx_casmarketing_domain_model_category, tx_casmarketing_domain_model_ad
            WHERE tx_casmarketing_domain_model_ad.ad_cat = tx_casmarketing_domain_model_category.uid ')  this is working but i want to conver it thourgh extbase query
  </code></pre>