/**
  * @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);
 }
Example #2
0
 public function testGetDefaultTreeBuilder()
 {
     $inst = Utils::getDefaultTreeBuilder();
     self::assertTrue($inst instanceof Utils\TreeBuilder);
 }
Example #3
0
 /**
  * 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;
 }