Documentation
IPS_IsChild
boolean IPS_IsChild (int $ObjectID, int $ParentID, boolean $Recursive)
Parameters
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 |
Returns
TRUE if the object is a child of the object with the ID ParentID, otherwise FALSE
Description
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.
Example
if (IPS_IsChild(0, 12345, true))
echo "The object 12345 is a descendent of the root object!";