boolean IPS_IsChild (integer $ObjectID, integer $ParentID, boolean $Recursive)
ObjectID | The ID of the object |
ParentID | The ID of the potential parent object |
Recursive | FALSE if only a direct parent-child relationship should be checked; TRUE if a relationship over multiple levels should also be checked |
TRUE if the object is a child of the object with the ID ParentID, otherwise FALSE |
This function checks if the object with the ID ObjectID is a child of the object with the ID ParentID. If the parameter Recursive is set to TRUE, all descendents of the parent node are checked and the function also returns TRUE if the object is multiple levels below the parent node, e.g., it is its grandchild. Otherwise, only the direct child objects of the parent are checked.
if (IPS_IsChild(0, 12345, true)) echo "The object 12345 is a descendent of the root object!";