[Dbix-class] Searching members of class

Rob Kinyon rob.kinyon at gmail.com
Fri Aug 28 20:30:37 GMT 2009


On Fri, Aug 28, 2009 at 16:02, Steve<steve at matsch.com> wrote:
> I've been trying to learn Catalyst, but realize that I probably have to
> become more familiar with DBIC first.  Anyway, I'm trying to write a method
> in my 'Divisions' class of which one attribute is called 'divisionname'.
>  How can I write a sub called 'default' that will look in this table to find
> the one and only one record whose 'divisionname' is 'DEFAULT'?  FYI, I've
> successfully used this class to search the resultset, but don't see how to
> search within my own class.

Your "class" is actually the class of the row object. Rows cannot
search - they solely exist to allow manipulation of a row. You don't
get from the row back to the resultset. You want to add a method to
the resultset for that table.

Rob



More information about the DBIx-Class mailing list