Browse Source

[Tree] Minor fixes

comfortablynumb 13 years ago
parent
commit
9f4b59182e

+ 1 - 1
lib/Gedmo/Tree/Entity/Repository/AbstractTreeRepository.php

@@ -51,7 +51,7 @@ abstract class AbstractTreeRepository extends EntityRepository
             throw new \Gedmo\Exception\InvalidMappingException('This repository cannot be used for tree type: ' . $treeListener->getStrategy($em, $class->name)->getName());
         }
 
-        $this->repoUtils = new \Gedmo\Tree\RepositoryUtils($this->_em, $this->getClassMetadata(), $this->listener, $this);
+        $this->repoUtils = new RepositoryUtils($this->_em, $this->getClassMetadata(), $this->listener, $this);
     }
 
     /**

+ 1 - 2
lib/Gedmo/Tree/Entity/Repository/MaterializedPathRepository.php

@@ -5,8 +5,7 @@ namespace Gedmo\Tree\Entity\Repository;
 use Gedmo\Exception\InvalidArgumentException,
     Gedmo\Tree\Strategy,
     Gedmo\Tree\Strategy\ORM\MaterializedPath,
-    Gedmo\Tool\Wrapper\EntityWrapper,
-    Gedmo\Exception\FeatureNotImplementedException;
+    Gedmo\Tool\Wrapper\EntityWrapper;
 
 /**
  * The MaterializedPathRepository has some useful functions

+ 3 - 37
lib/Gedmo/Tree/RepositoryUtils.php

@@ -29,22 +29,7 @@ class RepositoryUtils implements RepositoryUtilsInterface
     }
 
     /**
-     * Retrieves the nested array or the decorated output.
-     * Uses @options to handle decorations
-     *
-     * @throws \Gedmo\Exception\InvalidArgumentException
-     * @param object $node - from which node to start reordering the tree
-     * @param boolean $direct - true to take only direct children
-     * @param array $options :
-     *     decorate: boolean (false) - retrieves tree as UL->LI tree
-     *     nodeDecorator: Closure (null) - uses $node as argument and returns decorated item as string
-     *     rootOpen: string || Closure ('<ul>') - branch start, closure will be given $children as a parameter
-     *     rootClose: string ('</ul>') - branch close
-     *     childStart: string || Closure ('<li>') - start of node, closure will be given $node as a parameter
-     *     childClose: string ('</li>') - close of node
-     *     childSort: array || keys allowed: field: field to sort on, dir: direction. 'asc' or 'desc'
-     *
-     * @return array|string
+     * {@inheritDoc}
      */
     public function childrenHierarchy($node = null, $direct = false, array $options = array())
     {
@@ -70,21 +55,7 @@ class RepositoryUtils implements RepositoryUtilsInterface
     }
 
     /**
-     * Retrieves the nested array or the decorated output.
-     * Uses @options to handle decorations
-     * NOTE: @nodes should be fetched and hydrated as array
-     *
-     * @throws \Gedmo\Exception\InvalidArgumentException
-     * @param array $nodes - list o nodes to build tree
-     * @param array $options :
-     *     decorate: boolean (false) - retrieves tree as UL->LI tree
-     *     nodeDecorator: Closure (null) - uses $node as argument and returns decorated item as string
-     *     rootOpen: string || Closure ('<ul>') - branch start, closure will be given $children as a parameter
-     *     rootClose: string ('</ul>') - branch close
-     *     childStart: string || Closure ('<li>') - start of node, closure will be given $node as a parameter
-     *     childClose: string ('</li>') - close of node
-     *
-     * @return array|string
+     * {@inheritDoc}
      */
     public function buildTree(array $nodes, array $options = array())
     {
@@ -134,12 +105,7 @@ class RepositoryUtils implements RepositoryUtilsInterface
     }
 
     /**
-     * Process nodes and produce an array with the
-     * structure of the tree
-     *
-     * @param array - Array of nodes
-     *
-     * @return array - Array with tree structure
+     * {@inheritDoc}
      */
     public function buildTreeArray(array $nodes)
     {