The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Salvation::Service::DataSet - Base class for DataSet

SYNOPSIS

 package YourSystem::Services::SomeService::DataSet;

 use Moose;

 extends 'Salvation::Service::DataSet';

 no Moose;

REQUIRES

Moose

DESCRIPTION

Applied roles

Salvation::Roles::ServiceReference

METHODS

To be called

fetch

 $dataset -> fetch();

Returns next row from the DataSet moving current position of internal iterator one step forward.

first

 $dataset -> first();

Returns first row from the DataSet.

get

 $dataset -> get();
 $dataset -> get( $index );

Returns a row from the DataSet. $index is an integer starting from zero. If $index is omitted - current position of internal iterator is used.

last

 $dataset -> last();

Returns last row from the DataSet.

seek

 $dataset -> seek( $index );

Sets position of internal iterator. $index is an integer starting from zero.

To be redefined

You can redefine following methods to achieve your own goals.

main

Should return an ArrayRef. One element - one row. Each element is an abstract object that will be processed by a view, or somehow else if you want to. The only argument is $self which is current view's instance.