[Dbix-class] To find or search?

Dermot paikkos at googlemail.com
Tue Sep 9 11:33:25 BST 2008


2008/9/9 Zbigniew Lukasiak <zzbbyy at gmail.com>:
> On Mon, Sep 8, 2008 at 3:29 PM, Dermot <paikkos at googlemail.com> wrote:
>> Hi,
>
> There is something confused here.  ->find does not return a list (nor
> a resultset - as one could infere from your naming convention).
> ->find returns a DBIx::Class::Row object - just one.  See
> http://search.cpan.org/~ash/DBIx-Class-0.08010/lib/DBIx/Class/ResultSet.pm#find
>
> If you want a list - then user search.
>

Yes your correct. My mistake. For a list I need to use search, find is
a single record based on it's id or it's unique constraint.

I wasn't sure if I should store the type or use some other perl(ish)
means to determine the type. So far I have only found one instance
where I need to look up a file by it's type.
I like the grep idea. The extension might work for a fake ENUM but
some of the extensions are the same (mulitple .mov).

Thanx for all the comment though.
Dp.



More information about the DBIx-Class mailing list