=for comment POD_DERIVED_INDEX_GENERATED
The following documentation is automatically generated.  Please do not edit
this file, but rather the original, inline with EntityModel::Storage::Perl
at lib/EntityModel/Storage/Perl.pm
(on the system that originally ran this).
If you do edit this file, and don't want your changes to be removed, make
sure you change the first line.

=cut

=head1 NAME

EntityModel::Storage::Perl - backend storage interface for L<EntityModel>

=head1 VERSION

version 0.102

=head1 SYNOPSIS

See L<EntityModel>.

=head1 DESCRIPTION

See L<EntityModel>.

This does not really qualify as a 'storage' module, since it's intended purely for use in
testing, providing an ephemeral backing store for entities which will disappear on program
termination.

=head1 METHODS

=head2 setup

=head2 apply_entity

Set up this entity in storage, by adding it to the list of keys and clearing the existing max_id.

=head2 read_primary

Get the primary keys for a table.

=head2 read_fields

Read all fields for a given entity.

=head2 table_list

Get a list of all the existing tables in the schema.

=head2 field_list

Returns a list of all fields for the given table.

=head2 read

Reads the data for the given entity and returns hashref with the appropriate data.

Parameters:

=over 4

=item * entity - L<EntityModel::Entity>

=item * id - ID to read data from

=back

Callbacks (included in parameter list above):

=over 4

=item * on_complete - called when the value has been read, includes the value

=back

=head2 _next_id

Returns the next ID for the given entity. Not intended to be called outside this package;
returns the value immediately rather than asynchronously.

=head2 create

Creates new entry for the given L<EntityModel::Entity>.

Parameters:

=over 4

=item * entity - L<EntityModel::Entity>

=item * data - actual data values

=back

Callbacks (included in parameter list above):

=over 4

=item * on_complete - called when the value has been created, will be passed the assigned ID

=back

=head2 store

Stores data to the given entity and ID.

Parameters:

=over 4

=item * entity - L<EntityModel::Entity>

=item * id - ID to store data to

=item * data - actual data values

=back

Callbacks (included in parameter list above):

=over 4

=item * on_complete - called when the value has been stored, will be passed the assigned ID

=back

=head2 remove

Removes given ID from storage.

Parameters:

=over 4

=item * entity - L<EntityModel::Entity>

=item * id - ID to store data to

=back

Callbacks (included in parameter list above):

=over 4

=item * on_complete - called when the value has been removed

=back

=head2 find

Callbacks (included in parameter list above):

=over 4

=item * on_item - called for each item

=item * on_not_found - called once if no items were found

=item * on_complete - called when no more items are forthcoming (regardless of whether any
were found or not)

=back

=head2 adjacent

Returns the adjacent values for the given ID.

Callbacks (included in parameter list above):

=over 4

=item * on_prev - called with the value of the previous item

=item * on_next - called with the value of the next item

=item * on_complete - called when both next and previous values have been identified

=back

=head2 outer

Returns the first and last values for the given ID.

Callbacks (included in parameter list above):

=over 4

=item * on_first - called with the value of the previous item

=item * on_last - called with the value of the next item

=item * on_complete - called when both next and previous values have been identified

=back

=head1 INHERITED METHODS

=over 4

=item L<EntityModel::Storage>

L<apply_model|EntityModel::Storage/apply_model>, L<apply_model_and_schema|EntityModel::Storage/apply_model_and_schema>, L<backend_ready|EntityModel::Storage/backend_ready>, L<first|EntityModel::Storage/first>, L<last|EntityModel::Storage/last>, L<next|EntityModel::Storage/next>, L<prev|EntityModel::Storage/prev>, L<register|EntityModel::Storage/register>, L<transaction_commit|EntityModel::Storage/transaction_commit>, L<transaction_end|EntityModel::Storage/transaction_end>, L<transaction_rollback|EntityModel::Storage/transaction_rollback>, L<transaction_start|EntityModel::Storage/transaction_start>, L<wait_for_backend|EntityModel::Storage/wait_for_backend>

=item L<Mixin::Event::Dispatch>

L<add_handler_for_event|Mixin::Event::Dispatch/add_handler_for_event>, L<clear_event_handlers|Mixin::Event::Dispatch/clear_event_handlers>, L<event_handlers|Mixin::Event::Dispatch/event_handlers>, L<invoke_event|Mixin::Event::Dispatch/invoke_event>, L<subscribe_to_event|Mixin::Event::Dispatch/subscribe_to_event>, L<unsubscribe_from_event|Mixin::Event::Dispatch/unsubscribe_from_event>

=item L<EntityModel::BaseClass>

L<clone|EntityModel::BaseClass/clone>, L<new|EntityModel::BaseClass/new>, L<sap|EntityModel::BaseClass/sap>

=back

=head1 AUTHOR

Tom Molesworth <cpan@entitymodel.com>

=head1 LICENSE

Copyright Tom Molesworth 2008-2011. Licensed under the same terms as Perl itself.
