1 package DBIx::Class::Serialize::Storable;
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!';
15 my ($self, $cloning) = @_;
16 my $to_serialize = { %$self };
18 # Dynamic values, easy to recalculate
19 delete $to_serialize->{$_} for qw/related_resultsets _inflated_column/;
21 return (Storable::nfreeze($to_serialize));
25 my ($self, $cloning, $serialized) = @_;
27 %$self = %{ Storable::thaw($serialized) };
36 DBIx::Class::Serialize::Storable - hooks for Storable nfreeze/thaw
38 =head1 DEPRECATION NOTE
40 This component is now B<DEPRECATED>. It has not been providing any useful
41 functionality for quite a while, and in fact destroys prefetched results
42 in its current implementation. Do not use!
46 # in a table class definition
47 __PACKAGE__->load_components(qw/Serialize::Storable/);
49 # meanwhile, in a nearby piece of code
50 my $cd = $schema->resultset('CD')->find(12);
51 # if the cache uses Storable, this will work automatically
52 $cache->set($cd->ID, $cd);
56 This component adds hooks for Storable so that result objects can be
57 serialized. It assumes that your result object class (C<result_class>) is
58 the same as your table class, which is the normal situation.
62 The following hooks are defined for L<Storable> - see the
63 documentation for L<Storable/Hooks> for detailed information on these
66 =head2 STORABLE_freeze
68 The serializing hook, called on the object during serialization. It
69 can be inherited, or defined in the class itself, like any other
74 The deserializing hook called on the object during deserialization.
76 =head1 AUTHOR AND CONTRIBUTORS
78 See L<AUTHOR|DBIx::Class/AUTHOR> and L<CONTRIBUTORS|DBIx::Class/CONTRIBUTORS> in DBIx::Class
82 You may distribute this code under the same terms as Perl itself.