Salvation::Service::DataSet - Base class for DataSet
package YourSystem::Services::SomeService::DataSet; use Moose; extends 'Salvation::Service::DataSet'; no Moose;
$dataset -> fetch();
Returns next row from the DataSet moving current position of internal iterator one step forward.
$dataset -> first();
Returns first row from the DataSet.
$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.
$dataset -> last();
Returns last row from the DataSet.
$dataset -> seek( $index );
Sets position of internal iterator.
$index is an integer starting from zero.
You can redefine following methods to achieve your own goals.
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.