
smith_t at denison
Jul 17, 2008, 1:54 PM
Post #3 of 5
(228 views)
Permalink
|
Thanks! On Thu, Jul 17, 2008 at 9:40 AM, Greg Heo <greg[at]node79.com> wrote: > Hi Trevor, > >> But I don't seem to find what I think I need. This function appears >> to return the Category object: >> @objs = list Bric::Biz::Category($crit); >> >> This is different then the Category ID, right? > > The list_ids() method previously discussed would be what you're looking for: > > @category_ids = Bric::Biz::Category->list_ids({ uri => '/my/uri/' }); > $m->out("my category ID is ".$category_ids[0]) if scalar(@category_ids)>0; > > lookup() is similar to list(), returning a category object, but will throw > an error if more than one category matches. So if you need a guaranteed > one-or-nothing match, use lookup() and then get_id() on the category object > it returns. > > All three functions accept the same list of parameters in the hash. > >
|