Changeset 1345 for trunk/LATMOS-Accounts/lib/LATMOS
- Timestamp:
- 05/29/15 17:30:51 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/objects.pm
r1329 r1345 210 210 $sth->execute(map { $first{$_} || undef } sort keys %first) or return; 211 211 212 my $obj = $class->new($base, $id); 212 my $lastid = $base->db->last_insert_id(undef, undef, $class->_object_table, undef); 213 my $sthid = $base->db->prepare_cached( 214 sprintf(q{select %s as k from %s where ikey = ?}, 215 $base->db->quote_identifier($class->_key_field), 216 $base->db->quote_identifier($class->_object_table), 217 ) 218 ); 219 $sthid->execute($lastid); 220 my $res = $sthid->fetchrow_hashref() or return; 221 222 my $obj = $class->new($base, $res->{k}) or return; 213 223 $obj->set_fields(%second); 214 224 215 1;225 return $res->{k}; 216 226 } 217 227
Note: See TracChangeset
for help on using the changeset viewer.