Richard Clamp > Class-Persist-0.02 > Class::Persist::Proxy

Download:
Class-Persist-0.02.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Source  

NAME ^

Class::Persist::Proxy - Proxy for an object not loaded yet

SYNOPSIS ^

  use Class::Persist::Proxy;
  $proxy = Class::Persist::Proxy->new();
  $proxy->class( "AClass" );
  $proxy->owner( $owner );
  $real = $proxy->load();

DESCRIPTION ^

  Framework to replace objects in the DB by Proxy objects.
  This allows delayed loading of objects.
  A proxy acts as the real object itself, it should be transparent.
  When a method is called on the proxy, the real object is loaded in place of the proxy.
  If owner() is defined, it will autoload the object based on owner id, 
  otherwise it will load the object based on real_id.

INHERITANCE ^

  Class::Persist::Base

METHODS ^

class( $class )

oid( $id )

Tries hard to return the oid of the object proxied, if it fails, returns the proxy oid.

class( $class )

Get / set class. If no class is given, tries to guess using Class::Persist::Tracker

owner( $obj )

Get / set owner. The owner is automatically proxied.

load()

Replace the proxy by its target object

proxy( $obj )

Replace object by proxy

SEE ALSO ^

Class::Persist

AUTHOR ^

Fotango

syntax highlighting: