On Thu, Jun 16, 2011 at 9:24 AM, Dan Horne <[email protected]> wrote:
> I'm not sure that I understand your query. The resultset has a Data::Page
> object which has the total number of rows, and should also handle the
> pagination for you:
Ah. Perhaps I should come clean. I'm not actually looking for
pagination but absolute offsets. I just wanted to avoid confusion but
it looks like I created it instead. The net effect though is that
Data::Page does nothing for me.
This is what I'm trying to do:
sub foo {
my ($self, $rs, $start, $end) = @_;
# we get absolute values one way but ResultSet wants 'em a different way
my ($limit, $offset) = convert_to_limit_offset($start, $end);
# if I put the limit/offset in the resultset passed in, this will be wrong
my $total = $rs->count;
# but if I don't, this will be wrong.
# this is where those values above would go
while (my $rec = $rs->next) {
# ...
}
# so what to do?
}
--
Dorian Taylor
http://doriantaylor.com/
_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/[email protected]