From 057d99cab54a49e8edd5f0b9c628e3c5722fc10a Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Sun, 30 Nov 2014 11:56:45 +0100 Subject: [PATCH] BpNode: add and use countChildren method --- library/Bpapp/BpNode.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/library/Bpapp/BpNode.php b/library/Bpapp/BpNode.php index 76d22c1..cab35e8 100644 --- a/library/Bpapp/BpNode.php +++ b/library/Bpapp/BpNode.php @@ -156,9 +156,14 @@ class BpNode extends Node } } + public function countChildren() + { + return count($this->getChildren()); + } + public function hasChildren() { - return count($this->children) > 0; + return $this->countChildren() > 0; } public function setDisplay($display)