Add a function for obtaining a child-node by its name.

refs T6
This commit is contained in:
Tim Schumacher 2013-12-10 21:25:07 +01:00
parent a899a4baf2
commit 948aba4436

View file

@ -178,6 +178,18 @@ class DokuWikiNameSpace extends DokuWikiNode {
return $this->nodes; return $this->nodes;
} }
public function hasChild($nodeName) {
if ($this->nodes->count() > 0) {
foreach($this->nodes as $node) {
/** @var DokuWikiNode $node */
if (($node instanceof DokuWikiPage) && ($node->getName() == $nodeName)) {
return $node;
}
}
}
return null;
}
} }
/** /**