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

SPOPS::Loopback - Simple SPOPS class used for testing rules and other goodies

SYNOPSIS

use SPOPS::Initialize;

my %config = (
  test => {
     class    => 'LoopbackTest',
     isa      => [ qw( SPOPS::Loopback ) ],
     field    => [ qw( id_field field_name ) ],
     id_field => 'id_field',
  },
);
SPOPS::Initialize->process({ config => $config });
my $object = LoopbackTest->new;
$object->save;
$object->remove;

DESCRIPTION

This is a simple SPOPS class that returns success for all operations. The serialization methods (save(), fetch(), fetch_group() and remove()) all call the pre/post action methods just like any other objects, so it is useful for testing out rules.

METHODS

fetch( $id )

Returns a new object initialized with the ID $id, calling the pre/post_fetch_action() methods first.

fetch_group()

Returns a list of new objects, initialized with IDs.

save()

Returns the object you called the method on. If this is an unsaved object (if it has not been fetched or saved previously), we call pre_fetch_id() and post_fetch_id() to trigger any key-generation actions.

Saved and unsaved objects both have pre/post_save_action() methods called.

remove()

Calls the pre/post_remove_action()

BUGS

None known.

TO DO

Nothing known.

SEE ALSO

SPOPS

COPYRIGHT

Copyright (c) 2001-2002 intes.net, inc.. All rights reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

AUTHORS

Chris Winters <chris@cwinters.com>