コード例 #1
0
 public function buildAggregatorFor(Node $n)
 {
     return clone $n->isLeaf() ? $this->protoForLeaves : $this->protoForInternalNodes;
 }
コード例 #2
0
 /**
  * @param Node $hierarchyDescription
  * @return NodeAggregator
  */
 private function buildAggregatorOfNodes(Node $hierarchyDescription)
 {
     return new NodeAggregator($hierarchyDescription->getName(), array_map(function (Node $childNode) {
         return $this->buildAggregatorOfNodes($childNode);
     }, $hierarchyDescription->getChildren()), $this->nodeAggregatorFactory->buildAggregatorFor($hierarchyDescription));
 }