| 1 | package DBIx::Class::Serialize::Storable; | ||
| 2 | 2 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | 2 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | |||
| 5 | 2 | ▶ | use Storable(); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 2 | ▶ | use DBIx::Class::Carp; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | 2 | ▶ | use namespace::clean; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | |||
| 9 | 2 | 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 | 0 | ▶ | sub STORABLE_freeze { |
|
Subroutine
STORABLE_freeze: not called CC=2 SCAR=17.9
Pod
documented
| |||
| 15 | 0 | 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 | 0 | ▶ | sub STORABLE_thaw { |
|
Subroutine
STORABLE_thaw: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 25 | 0 | my ($self, $cloning, $serialized) = @_; | |
| 26 | |||
| 27 | 0 | %$self = %{ Storable::thaw($serialized) }; | |
| 28 | } | ||
| 29 | |||
| 30 | 2 | 1; | |
| 31 | |||
| 32 | __END__ | ||