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