1 package # hide from PAUSE
2 DBIx::Class::CDBICompat::Copy;
7 use base 'DBIx::Class';
14 DBIx::Class::CDBICompat::Copy - Emulates Class::DBI->copy($new_id)
18 See DBIx::Class::CDBICompat for usage directions.
22 Emulates C<<Class::DBI->copy($new_id)>>.
27 # CDBI's copy will take an id in addition to a hash ref.
30 return $self->next::method($arg) if ref $arg;
32 my @primary_columns = $self->primary_columns;
33 croak("Need hash-ref to edit copied column values")
34 if @primary_columns > 1;
36 return $self->next::method({ $primary_columns[0] => $arg });
39 =head1 FURTHER QUESTIONS?
41 Check the list of L<additional DBIC resources|DBIx::Class/GETTING HELP/SUPPORT>.
43 =head1 COPYRIGHT AND LICENSE
45 This module is free software L<copyright|DBIx::Class/COPYRIGHT AND LICENSE>
46 by the L<DBIx::Class (DBIC) authors|DBIx::Class/AUTHORS>. You can
47 redistribute it and/or modify it under the same terms as the
48 L<DBIx::Class library|DBIx::Class/COPYRIGHT AND LICENSE>.