Andy Grundman > DBIx-Class-0.03003 > DBIX::Class::Recordset

Download:
DBIx-Class-0.03003.tar.gz

Annotate this POD

CPAN RT

New  15
Open  16
Stalled  12
View/Report Bugs
Source   Latest Release: DBIx-Class-0.082700_01

NAME ^

DBIX::Class::Recordset - Responsible for fetching and creating recordsets.

SYNOPSIS; ^

$rs=MyApp::DB::Class->search(registered=>1);

DESCRIPTION ^

The recordset is also know as an iterator.

METHODS ^

new <db_class> <attrs>

The recordset constructor. Takes a db class and an attribute hash (see below for more info on attributes)

cursor

Return a storage driven cursor to the given record set.

slice <first> <last>

return a number of elements from the given record set.

next

Returns the next element in this record set.

count

Performs an SQL count with the same query as the resultset was built with to find the number of elements.

all

Returns all elements in the recordset. Is called implictly if the search method is used in list context.

reset

Reset this recordset's cursor, so you can iterate through the elements again.

first

resets the recordset and returns the first element.

delete

Deletes all elements in the recordset.

pager

Returns a Data::Page object for the current resultset. Only makes sense for queries with page turned on.

page <page>

Returns a new recordset representing a given page.

Attributes ^

The recordset is responsible for handling the various attributes that can be passed in with the search functions. Here's an overview of them:

order_by

Which column to order the results by.

cols

Which cols should be retrieved on the first search.

join

Contains a list of relations that should be joined for this query. Can also contain a hash referece to refer to that relation's relations.

from

This attribute can contain a arrayref of elements. each element can be another arrayref, to nest joins, or it can be a hash which represents the two sides of the join.

*NOTE* Use this on your own risk. This allows you to shoot your foot off!

page

Should the resultset be paged? This can also be enabled by using the 'page' option.

rows

For paged resultsset, how many rows per page

offset

For paged resultsset, which page to start on.

1;

syntax highlighting: