The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Class::Persist::Proxy::Collection - Proxy for objects not loaded yet

SYNOPSIS

  use qw( Class::Persist::Proxy::Collection );
  my $proxy = Class::Persist::Proxy::Collection->new();
  $proxy->class('Class::Persist::Address');
  $proxy->owner( $contact );
  $proxy->push($object1, $object2);
  $proxy->store();
  $obj1 = $proxy->object_at_index(0);
  

DESCRIPTION

  Replace several objects in the DB by a Proxy object.
  This allows delayed loading of objects.

INHERITANCE

  Class::Persist::Proxy EO::Array

METHODS

element

When called for the first time, create an array of proxies representing the real objects.

load()

Replace all the element by proxies

store()

Store any non proxy element in the collection and proxy it

delete( $index )

Without parameter, delete all the elements of the collection. If an index is given, deletes the related element.

SEE ALSO

Class::Persist

AUTHOR

Fotango