1Rose::DB::Object::Std::UCsaecrheCdo(n3t)ributed Perl DocRuomseen:t:aDtBi:o:nObject::Std::Cached(3)
2
3
4

NAME

6       Rose::DB::Object::Std::Cached - Memory cached standardized object
7       representation of a single row in a database table.
8

SYNOPSIS

10         package Category;
11
12         use base 'Rose::DB::Object::Std::Cached';
13
14         __PACKAGE__->meta->setup
15         (
16           table => 'categories',
17
18           columns =>
19           [
20             id          => { type => 'int', primary_key => 1 },
21             name        => { type => 'varchar', length => 255 },
22             description => { type => 'text' },
23           ],
24
25           unique_key => 'name',
26         );
27
28         ...
29
30         $cat1 = Category->new(id   => 123,
31                               name => 'Art');
32
33         $cat1->save or die $category->error;
34
35
36         $cat2 = Category->new(id => 123);
37
38         # This will load from the memory cache, not the database
39         $cat2->load or die $cat2->error;
40
41         # $cat2 is the same object as $cat1
42         print "Yep, cached"  if($cat1 eq $cat2);
43
44         # No, really, it's the same object
45         $cat1->name('Blah');
46         print $cat2->name; # prints "Blah"
47
48         ...
49

DESCRIPTION

51       "Rose::DB::Object::Std::Cached" is a subclass of both
52       Rose::DB::Object::Std and Rose::DB::Object::Cached.  It simply combines
53       the features of both classes.  See the Rose::DB::Object::Std and
54       Rose::DB::Object::Cached documentation for more information.
55

AUTHOR

57       John C. Siracusa (siracusa@gmail.com)
58

LICENSE

60       Copyright (c) 2010 by John C. Siracusa.  All rights reserved.  This
61       program is free software; you can redistribute it and/or modify it
62       under the same terms as Perl itself.
63
64
65
66perl v5.28.0                      2015-03-18  Rose::DB::Object::Std::Cached(3)
Impressum