Pangloss::Application::CollectionEditor - abstract collection editor app.
# abstract - cannot be used directly package App::FooEditor; use base qw( Pangloss::Application::CollectionEditor ); my $foo_editor = new App::FooEditor; my $view = $foo_editor->add( $obj ); $foo_editor->get( $key, $view ); $foo_editor->update( $key, $obj, $view ); $foo_editor->remove( $key, $view );
This class implements a collection editor application for Pangloss.
It inherits from Pangloss::Application::Base.
These methods throw an Error if they cannot perform their jobs. On success, each returns a Pangloss::Application::View. Most set the collection as $view->{object_name}, and a flag indicating the operation performed.
add a collection. sets $view->{collection_added}. throws an error if a collection exists, or the collection is invalid.
sets $view->{objects_name . '_collection'} to a deep clone of the collection and sets $view->{objects_name} to the list of items as a shortcut. (Note the plural: objects_name)
get a collection. sets $view->{object_name} only. throws an error if the collection does not exist.
modifies collection named by $key. copies $obj. sets $view->{object_name . '_modified'}. throws an error if the collection does not exist.
get a collection. sets $view->{object_name . '_removed'}. throws an error if the collection does not exist.
test to see if the named item exists in the collection.
Override the following methods:
constant. name to use for this object in the $view.
constant. name to use for lists of this object in the $view.
constant. collection name to use in the store (ie: Pixie).
constant. class of collection to use.
abstract. indicates that a Pangloss::Error should be thrown.
Steve Purkis <spurkis@quiup.com>
Pangloss, Pangloss::Collection
To install Pangloss, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Pangloss
CPAN shell
perl -MCPAN -e shell install Pangloss
For more information on module installation, please visit the detailed CPAN module installation guide.