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