Add a function for obtaining a child-node by its name.
refs T6
This commit is contained in:
parent
a899a4baf2
commit
948aba4436
1 changed files with 12 additions and 0 deletions
|
@ -178,6 +178,18 @@ class DokuWikiNameSpace extends DokuWikiNode {
|
|||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Reference in a new issue