1 package DBIx::Class::Serialize;
3 use Storable qw/freeze thaw/;
6 my ($self,$cloning) = @_;
8 my $to_serialize = { %$self };
9 delete $to_serialize->{result_source};
10 return (freeze($to_serialize));
14 my ($self,$cloning,$serialized) = @_;
15 %$self = %{ thaw($serialized) };
17 my $class = ${(ref $self) . '::ISA'}[0];
18 my $schema = DB->schema;
19 $self->result_source($schema->source($class));