[open-ils-commits] r12335 - in trunk/Open-ILS/src/perlmods/OpenILS: Application/Trigger Utils (miker)
svn at svn.open-ils.org
svn at svn.open-ils.org
Sun Mar 1 15:10:59 EST 2009
Author: miker
Date: 2009-03-01 15:10:55 -0500 (Sun, 01 Mar 2009)
New Revision: 12335
Modified:
trunk/Open-ILS/src/perlmods/OpenILS/Application/Trigger/Event.pm
trunk/Open-ILS/src/perlmods/OpenILS/Utils/Fieldmapper.pm
Log:
adding controller intellegence to Fieldmapper.pm and Event.pm
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Trigger/Event.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Trigger/Event.pm 2009-03-01 18:51:40 UTC (rev 12334)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Trigger/Event.pm 2009-03-01 20:10:55 UTC (rev 12335)
@@ -428,7 +428,11 @@
$meth =~ s/Fieldmapper:://;
$meth =~ s/::/_/;
- my $obj = $self->editor->$meth(
+ my $ed = grep( /open-ils.cstore/, @{$fclass->Controller} ) ?
+ $self->editor :
+ new_rstore_editor();
+
+ my $obj = $ed->$meth(
($multi) ? { $ffield => $context->$lfield() } : $context->$lfield() );
if (@$path) {
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Utils/Fieldmapper.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Utils/Fieldmapper.pm 2009-03-01 18:51:40 UTC (rev 12334)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Utils/Fieldmapper.pm 2009-03-01 20:10:55 UTC (rev 12335)
@@ -59,6 +59,7 @@
$$fieldmap{$n}{hint} = $c;
$$fieldmap{$n}{virtual} = ($idl->{$c}{'oils_persist:virtual'} && $idl->{$c}{'oils_persist:virtual'} eq 'true') ? 1 : 0;
$$fieldmap{$n}{table} = $idl->{$c}{'oils_persist:tablename'};
+ $$fieldmap{$n}{controller} = [ split ' ', $idl->{$c}{'controller'} ];
$$fieldmap{$n}{restrict_primary} = $idl->{$c}{'oils_persist:restrict_primary'};
$$fieldmap{$n}{sequence} = $idl->{$c}{fields}{'oils_persist:sequence'};
$$fieldmap{$n}{identity} = $idl->{$c}{fields}{'oils_persist:primary'};
@@ -192,6 +193,11 @@
return $$fieldmap{$self->class_name}{table};
}
+sub Controller {
+ my $self = shift;
+ return $$fieldmap{$self->class_name}{controller};
+}
+
sub class_name {
my $class_name = shift;
return ref($class_name) || $class_name;
More information about the open-ils-commits
mailing list