@properties = $session->getAllProperties( $object, $flag );

The getAllProperties() function returns the names and values of all the properties of the specified object:

  • If $flag is 0, attributes only are returned.

  • If $flag is 1, relations only are returned.

  • If $flag is 2, both attributes and relations are returned.

    The @properties array contains an even number of elements, where the odd-numbered ones are the property names, and the even-numbered are the matching values. This convention means that you can treat the result as a Perl hash, as shown in the following examples:

  • The first example:

     %props = $s->getAllProperties( $obj, 2 );
     print "Object Name is $props{Name}\n”;
    
  • The second example:

    use Data::Dumper;
    print Dumper( \%props );
    

    The “_t” variation of the call returns data types as well as values.

    Consider using the get() or get_t() functions of the InCharge::object module with no arguments instead of this call, as shown in the following example:

     %props = $obj->get( );
     print Dumper( \%props );