title: Doctrine 2 Tree Extension: Closure Table
body: <p>I'm using Tree - Nestedset behavior extension for Doctrine 2 and Closure Table Strategy. On my web, users can create folders and subfolders and view them. I implemented this by using Closure Table strategy and I render folders with <strong>childrenHierarchy()</strong> method:</p>
  
  <pre><code>       $directoryTree = $repository-&gt;childrenHierarchy(
              null,  
              true,  
              array(
          'decorate' =&gt; false,
          'childSort' =&gt; array('field' =&gt; 'directory_name', 'dir' =&gt; 'asc')
      ));
  </code></pre>
  
  <p>It works fine, but it returns all folders for all users and I don't know how to define <strong>user_id</strong> in this case to render only folders, that belong to login user. Is there any way to do this? </p>
  
  <p>I will glad for your answers.</p>