[Dbix-class] search vs. find

John Goulah jgoulah at gmail.com
Tue Jun 5 23:09:14 GMT 2007


So I've noticed that search returns a "resultset"
(MyApp::ResultSet::Tablename) and find returns a "row_object"
(MyApp::Model::MyDB::Tablename).  I suppose this makes some sense since
search may return many rows while find is designed to find one row.  However
it seems that its more useful to deal with the resultset object, for example
if I have defined my own custom resultset functions within, I can reuse this
returned object to call them, perhaps even using some of the already
populated fields as parts of the where clause (such as a primary key like
user_id).  Maybe not the best idea, but seems easier than passing the same
user_id into each query.   In any case, is there any way to force/cast the
"row_object" into a result set, or are we stuck with only using search if we
want a ResultSet back?

Thanks,
John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20070605/db0=
989a9/attachment.htm


More information about the Dbix-class mailing list