GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  ROSE::DB::OBJECT::STD::CACHED (3)

.ds Aq ’

NAME

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

CONTENTS

SYNOPSIS



  package Category;

  use base Rose::DB::Object::Std::Cached;

  __PACKAGE__->meta->setup
  (
    table => categories,

    columns =>
    [
      id          => { type => int, primary_key => 1 },
      name        => { type => varchar, length => 255 },
      description => { type => text },
    ],

    unique_key => name,
  );

  ...

  $cat1 = Category->new(id   => 123,
                        name => Art);

  $cat1->save or die $category->error;


  $cat2 = Category->new(id => 123);

  # This will load from the memory cache, not the database
  $cat2->load or die $cat2->error;

  # $cat2 is the same object as $cat1
  print "Yep, cached"  if($cat1 eq $cat2);

  # No, really, its the same object
  $cat1->name(Blah);
  print $cat2->name; # prints "Blah"

  ...



DESCRIPTION

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

AUTHOR

John C. Siracusa (siracusa@gmail.com)

LICENSE

Copyright (c) 2010 by John C. Siracusa. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 ROSE::DB::OBJECT::STD::CACHED (3) 2015-03-17

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.