$count = $obj->countElements( $relation )

Counts the number of elements in the given relationship. The countElements method will throw an error if $relation is not a relationship.

 $count = $obj->countElements( "ComposedOf" );