2010-08-16 106 views
0

我使用DoctrineExtensions\NestedSetDoctrine2 NestedSet扩展:渲染孩子

我试图渲染子节点的节点。我用

$node->getChildren(); 

array 
    0 => 
    object(DoctrineExtensions\NestedSet\NodeWrapper)[218] 
     private 'node' => 
     object(Application\Models\Post)[240] 
      protected 'id' => int 3 
      protected 'title' => string 'trying to use zend_auth' (length=23) 
      protected 'body' => string 'hello world' (length=11) 
      protected 'thumbnail' => string '' (length=0) 
      protected 'dtPosted' => 
      object(DateTime)[252] 
       ... 
      protected 'dtLastAction' => 
      object(DateTime)[247] 
       ... 
      protected 'lft' => int 2 
      protected 'rgt' => int 3 
      protected 'root' => int 1 
      protected 'user' => 
      object(Application\Proxies\ApplicationModelsUserProxy)[159] 
       ... 
      protected 'tags' => 
      object(Doctrine\ORM\PersistentCollection)[233] 
       ... 
     private 'manager' => 
     object(DoctrineExtensions\NestedSet\Manager)[204] 
      ... 

我得到的NodeWrapper秒的阵列。我正试图从中得到我的Post对象。我该怎么做?

回答

0

NodeWrapper $n,请拨打$n->getNode()以获取由NodeWrapper包装的项目。