File Coverage

blib/lib/DBIx/Class/Serialize/Storable.pm
Criterion Covered Total %
statement 15 22 68.1
branch n/a
condition n/a
subroutine 5 7 71.4
pod 2 2 100.0
total 22 31 70.9


line stmt bran cond sub pod time code
1             package DBIx::Class::Serialize::Storable;
2 2     2   1323 use strict;
  2         6  
  2         50  
3 2     2   8 use warnings;
  2         4  
  2         38  
4              
5 2     2   17 use Storable();
  2         4  
  2         27  
6 2     2   9 use DBIx::Class::Carp;
  2         2  
  2         16  
7 2     2   11 use namespace::clean;
  2         4  
  2         14  
8              
9             carp 'The Serialize::Storable component is now *DEPRECATED*. It has not '
10             .'been providing any useful functionality for quite a while, and in fact '
11             .'destroys prefetched results in its current implementation. Do not use!';
12              
13              
14             sub STORABLE_freeze {
15 0     0 1   my ($self, $cloning) = @_;
16 0           my $to_serialize = { %$self };
17              
18             # Dynamic values, easy to recalculate
19 0           delete $to_serialize->{$_} for qw/related_resultsets _inflated_column/;
20              
21 0           return (Storable::nfreeze($to_serialize));
22             }
23              
24             sub STORABLE_thaw {
25 0     0 1   my ($self, $cloning, $serialized) = @_;
26              
27 0           %$self = %{ Storable::thaw($serialized) };
  0            
28             }
29              
30             1;
31              
32             __END__