Dear friends
Sorry for newbie question!
I'd like to know, how to get the last inserted row's primary key after a
populate?
I have the following code in a Catalyst app (it inserts data to related
tables too, but in the main table: FoldkHrsz only one row):
# DB Populate
my $hrsz_res = $c->model('DB::FoldkHrsz')->populate([
{
%$hrsz_data,
foldk_alreszlets => \@$alreszlet_AoH,
foldk_szeljegyzetts => \@$szeljegyzett_adat_AoH,
foldk_szolgalmis => \@$szolgalmi_adat_AoH,
foldk_tulajs => \@$tulaj_adat_AoH,
foldk_jogok_tenyeks => \@$jogok_tenyek_adat_AoH
},
]);
After this, if i try to get the last inserted row's PK with this:
$hrsz_res->id;
..gives an error:
"Can't call method "id" on unblessed reference at ..."
I know, that the populate method's result is:
\@result_objects (scalar context) | @result_objects (list context)
but don't know, how to use them?
Thank You in advance!
Best wishes from Hungary.
Csaba Hetenyi
_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk