NAME

OpenInteract2::Setup::InitializeSPOPS - Initialize SPOPS classes

SYNOPSIS

my $setup = OpenInteract2::Setup->new( 'initialize spops' );
$setup->run();

DESCRIPTION

This setup action passes the SPOPS configuration (returned by the context method spops_config() to process() in SPOPS::Initialize. This generates the SPOPS classes into existence.

We also require() any referenced alias_class keys from the SPOPS configuration. This is useful for when you want to add behavior to a generated SPOPS class. So you'd declare it like this:

[myobject]
class       = OpenInteract2::MyObjectPersist
alias_class = OpenInteract2::MyObject

And then implement it:

package OpenInteract2::MyObject

use strict;
@OpenInteract::MyObject::ISA = qw( OpenInteract::MyObjectPersist );

sub some_custom_method { ... }

The class 'OpenInteract2::MyObject' is what's returned when you call lookup_object() on the context:

my $object_class = CTX->lookup_object( 'myobject' );
# $object_class is now 'OpenInteract2::MyObject'
$object_class->some_custom_method;

Setup Metadata

name - 'initialize spops'

dependencies - 'read spops config'

SEE ALSO

SPOPS::Initialize

OpenInteract2::Setup

COPYRIGHT

Copyright (c) 2005 Chris Winters. 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>