[Dbix-class] Ok, let's begin

Matt S Trout dbix-class at trout.me.uk
Tue Sep 20 22:27:08 CEST 2005


On Tue, Sep 20, 2005 at 11:08:32PM +0200, Krzysztof Krzyzaniak wrote:
> >>and finally I have
> >>
> >>DBIx::Class::ResultSet and DBIx::Class::ResultSet->pager. In which way I 
> >>can use it? (I mean maybe there is some iterator class in ResultSet?)
> >
> >
> >ResultSet *is* an iterator.
> >
> >$rs->next will return an object
> >$rs->all will return all objects in the resultset
> >$rs->reset does what you expect
> >$rs->count will count rows (via COUNT(*) without fetching data)
> >$rs->delete deletes all records in the resultset
> 
> Woow! It's alive![1]
> 
> Thank you very much.
> 
> [1]
> 
> [% WHILE (record = records.next) %]
> 
>  ... do the Bartman
> 
> [% END %]

Plus - $rs->page(1) will return a $rs (or @obj) encapsulating the first page
of the rs. 'rows' is your search attr to set rows per page.

-- 
     Matt S Trout       Specialists in perl consulting, web development, and
  Technical Director    UNIX/Linux systems architecture and automation. Mail
Shadowcat Systems Ltd.  mst (at) shadowcatsystems.co.uk for more information

 + Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +



More information about the Dbix-class mailing list