From: erickson Date: Tue, 31 Mar 2009 20:55:47 +0000 (+0000) Subject: removed remaining assumptions of an 'id' field on all objects. use Identity column... X-Git-Tag: sprint4-merge-nov22~10364 X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=37b7ff6e5a2059e32bfd7b84568fcdf1cc0f1838;p=working%2FEvergreen.git removed remaining assumptions of an 'id' field on all objects. use Identity column everywhere git-svn-id: svn://svn.open-ils.org/ILS/trunk@12743 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/perlmods/OpenILS/Utils/CStoreEditor.pm b/Open-ILS/src/perlmods/OpenILS/Utils/CStoreEditor.pm index 0450c19d13..c4b7f34bc5 100644 --- a/Open-ILS/src/perlmods/OpenILS/Utils/CStoreEditor.pm +++ b/Open-ILS/src/perlmods/OpenILS/Utils/CStoreEditor.pm @@ -581,7 +581,8 @@ sub __arg_to_string { my $arg = shift; return "" unless defined $arg; if( UNIVERSAL::isa($arg, "Fieldmapper") ) { - return (defined $arg->id) ? $arg->id : ''; + my $idf = $arg->Identity; + return (defined $arg->$idf) ? $arg->$idf : ''; } return OpenSRF::Utils::JSON->perl2JSON($arg); return ""; @@ -625,8 +626,9 @@ sub runmethod { $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 @@ sub runmethod { } 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