From: Chris W. <ch...@cw...> - 2003-04-29 12:20:11
|
Nick Sutterer wrote: > is there a way to get information about the properties of a SPOPS object, > like fieldnames, related objects, and so on? > i think i read about such a mechanism, but couldn't find it in the manual. You always have access to an SPOPS object's configuration using the class method CONFIG: my $conf = $spops_class->CONFIG; print "Fields are: ", join( ', ', $conf->{field_list} ); Some of the properties are accessible directly via class methods: print "Fields are: ", join( ', ', $spops_class->field_list ), "and the ID field is: ", $spops_class->id_field; I'm almost positive we're not tracking related objects directly, but since you have access to the configuration you can parse the 'has_a' and 'links_to' declarations to get the information. This is non-optimal, and suggestions are welcome. Later, Chris |