Documentation
getParent
usage
$node = $nql->getParent()
retourne
the parent node of the selected node
exemples
include_once('../Kernel/common/nql.class.php');
$nql = new NQL();
$nql->addCommand(
'<SEARCH name="senior">
<CONTACT>
<INFO>
<BIRTHDAY operator="GT">1979-01-01</BIRTHDAY>
</INFO>
</CONTACT>
</SEARCH>'
);
$nql->addCommand(
'<SEARCH name="junior">
<CONTACT>
<INFO>
<BIRTHDAY operator="LT">1979-01-01</BIRTHDAY>
</INFO>
</CONTACT>
</SEARCH>'
);
$nql->execute();
$contacts = $nql->getElements('/RESPONSE/RESULTS/CONTACT');
foreach( $contacts $one_contact){
$parent = $contact->getParent();
if( $parent->getAttribute('name')=='senior' ){
...
}else{
...
}
}