コード例 #1
0
 /**
  * @param Compound $root
  * @param bool $prepend
  */
 public function attachToCompound(Compound $root, $prepend = false)
 {
     parent::attachToCompound($root, $prepend);
     // try to update pagination immediately
     // because it can be rendered before this component.
     $this->paginationControl || Utils::applyCallback(function (PaginationControl $pagination) {
         $this->paginationControl || $this->setPaginationControl($pagination);
     }, $root, PaginationControl::class);
 }
コード例 #2
0
ファイル: UtilsTest.php プロジェクト: nayjest/tree
 public function testGetDefaultTreeBuilder()
 {
     $inst = Utils::getDefaultTreeBuilder();
     self::assertTrue($inst instanceof Utils\TreeBuilder);
 }
コード例 #3
0
ファイル: Tree.php プロジェクト: nayjest/tree
 /**
  * Tree constructor.
  *
  * @param ParentNodeInterface $root
  * @param array               $hierarchy
  * @param array|Registry      $nodes
  */
 public function __construct(ParentNodeInterface $root, array $hierarchy, $nodes)
 {
     $this->hierarchy = $hierarchy;
     $this->nodes = $nodes instanceof Registry ? $nodes : new Registry($nodes);
     $this->builder = Utils::getDefaultTreeBuilder();
     $this->root = $root;
 }