[OPEN-ILS-DEV] A/T Validator Reading Stat Cats
David Busby
david.busby at edoceo.com
Wed Jan 11 02:05:15 EST 2012
Greetings,
I've gotten very close on this StatCat validator functioning pretty OK now.
But, oddly I'm only able to get the stat_cat ID out of the data; but
I need to match to the name of that item (or, would like to)
Here's some snip from the validator code:
my($self, $env) = @_;
my $u = $env->{target}->usr;
foreach my $sce (@{$u->stat_cat_entries}) {
# Here is where I expect $sce->stat_cat->name to maybe have some data?
# It does not :(
# $sce->id = 1
# $sce->stat_cat = 1
# $sce->stat_cat_entry = Yes
# $sce->target_usr = 389
# I wanted this to work:
my $name = $sce->stat_cat->name;
}
I used Dumper to show what $sce was, looks like:
$VAR1 = bless( [
1,
1,
'Yes',
389
], 'Fieldmapper::actor::stat_cat_entry_user_map' );
I referenced to fm_IDL.xml, to find that the second item should be
stat_cat, which is a link to stat_cat, which then should have ->name -
right?
Since this is in my action/trigger Validator I thought I might need to
add items to the environment, but I don't know which are the right
ones.
So, in short: how do I locate the name of my stat_cat (in DB as
actor.stat_cat.name ) when in my Validator code?
--
David Busby
Edoceo, Inc.
http://edoceo.com/
206.282.6500
More information about the Open-ils-dev
mailing list