X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FCDBICompat%2FCopy.pm;h=59780e650ea828c0c5a750745230866ba45bd9e2;hb=7dc14bc09910cb750e5fe503dfa18a97eed490d1;hp=ed42d95142e697ee6aad4025f64b9f9c56f265ec;hpb=b24d86a1fbeb89083bc2eeeeb286d590ffea702a;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/CDBICompat/Copy.pm b/lib/DBIx/Class/CDBICompat/Copy.pm index ed42d95..59780e6 100644 --- a/lib/DBIx/Class/CDBICompat/Copy.pm +++ b/lib/DBIx/Class/CDBICompat/Copy.pm @@ -4,7 +4,10 @@ package # hide from PAUSE use strict; use warnings; +use base 'DBIx::Class'; + use Carp; +use namespace::clean; =head1 NAME @@ -12,7 +15,7 @@ DBIx::Class::CDBICompat::Copy - Emulates Class::DBI->copy($new_id) =head1 SYNOPSIS -See DBIx::Class::CDBICompat for directions for use. +See DBIx::Class::CDBICompat for usage directions. =head1 DESCRIPTION @@ -25,7 +28,7 @@ Emulates C<copy($new_id)>>. sub copy { my($self, $arg) = @_; return $self->next::method($arg) if ref $arg; - + my @primary_columns = $self->primary_columns; croak("Need hash-ref to edit copied column values") if @primary_columns > 1; @@ -33,4 +36,17 @@ sub copy { return $self->next::method({ $primary_columns[0] => $arg }); } +=head1 FURTHER QUESTIONS? + +Check the list of L. + +=head1 COPYRIGHT AND LICENSE + +This module is free software L +by the L. You can +redistribute it and/or modify it under the same terms as the +L. + +=cut + 1;