$count = $session->countChildren( $class )

The countChildren() function counts the child classes of the specified class.

 $class = "ICIM_UnitaryComputerSystem";
 $n = $session->countChildren($class);