title: How to find table related with an alias in Doctrine ORM query?
body: <p>I'm using Doctrine ORM 1.2 and Symfony 1.4 and I want to create method in myUser class which will extend Doctrine_Query instance passed as an argument with some additional left joins and conditions. The trick is that I don't always want these these left joins to be made with root component of the query and I need to know with what table (record class) the alias corresponds - in some cases I would like to pass an alias of another component and expect it to be supplemented with some extra left joins and conditions.</p>
  
  <p>My question is how can I check what component (essentially table) represents given alias? Suppose I create a Doctrine_Query instance:</p>
  
  <pre><code>$query = Doctrine_Query::create();
  $query-&gt;from('Folder f')-&gt;leftJoin('f.ChildFolders cf');
  </code></pre>
  
  <p>Now I want my method in myUser class to add some joins to the table with alias 'cf' but varying depending on table which 'cf' aliases. I want to call it this way:</p>
  
  <pre><code>$this-&gt;getUser()-&gt;limitQueryResultsWithSomeCondition($query, 'cf');
  </code></pre>
  
  <p>That should return query with additional elements. How can I find out what table is symbolized by 'cf' alias and whether it exists at all in given query? </p>
  
  <p>It is quite straightforward when it is root table of a query that needs to be extended, but I cannot find a way to do it in other cases.</p>