title: filter doctrine nested set tree children hierarchy
body: <p>I am using a doctrine nested set tree in my application.</p>
  
  <p>I can easily retrieve the whole tree using </p>
  
  <pre><code>        $repo-&gt;childrenHierarchy(
              null, /* starting from root nodes */
              false, /* false: load all children, true: only direct */
              $options
          )
  </code></pre>
  
  <p>What I want though is to filter entities of this tree according to a foreign key (categories belong to users so each category has a userId)</p>
  
  <p>Unfortunately the option that accepts a callback to filter on the node does not allow filtering on a foreign key, foreign keys values are not included in the node array :</p>
  
  <pre><code>    $options = array(
          'decorate'  =&gt; true,
          'rootOpen'  =&gt; '&lt;ul&gt;',
          'rootClose' =&gt; '&lt;/ul&gt;',
          'childOpen' =&gt;  function ($node) use($user) {
              // $node does not contain any foreign key
              if ($node['userId'] != $user-&gt;getId()) {
                  return null;
              }
              return "&lt;li id='".$node['id']."'&gt;";
          },
          'childClose' =&gt; '&lt;/li&gt;',
      );
  </code></pre>
  
  <p>How can I solve this issue ?</p>