[open-ils-commits] r12743 - trunk/Open-ILS/src/perlmods/OpenILS/Utils (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Mar 31 16:55:51 EDT 2009
Author: erickson
Date: 2009-03-31 16:55:47 -0400 (Tue, 31 Mar 2009)
New Revision: 12743
Modified:
trunk/Open-ILS/src/perlmods/OpenILS/Utils/CStoreEditor.pm
Log:
removed remaining assumptions of an 'id' field on all objects. use Identity column everywhere
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Utils/CStoreEditor.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Utils/CStoreEditor.pm 2009-03-31 20:32:04 UTC (rev 12742)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Utils/CStoreEditor.pm 2009-03-31 20:55:47 UTC (rev 12743)
@@ -581,7 +581,8 @@
my $arg = shift;
return "" unless defined $arg;
if( UNIVERSAL::isa($arg, "Fieldmapper") ) {
- return (defined $arg->id) ? $arg->id : '<new object>';
+ my $idf = $arg->Identity;
+ return (defined $arg->$idf) ? $arg->$idf : '<new object>';
}
return OpenSRF::Utils::JSON->perl2JSON($arg);
return "";
@@ -625,8 +626,9 @@
$self->event(_mk_not_found($type, $arg));
return undef;
} elsif( ref($arg) =~ /Fieldmapper/ ) {
- $self->log(D,"$action $type called with an object.. attempting ID retrieval..");
- $arg = $arg->id;
+ $self->log(D,"$action $type called with an object.. attempting Identity retrieval..");
+ my $idf = $arg->Identity;
+ $arg = $arg->$idf;
}
}
@@ -729,8 +731,9 @@
}
if( $action eq 'create' ) {
- $self->log(I, "created a new $type object with ID " . $obj->id);
- $arg->id($obj->id);
+ my $idf = $obj->Identity;
+ $self->log(I, "created a new $type object with Identity " . $obj->$idf);
+ $arg->$idf($obj->$idf);
}
$self->data($obj); # cache the data for convenience
More information about the open-ils-commits
mailing list