KonaKart Community Forum

Installation / Configuration => Programming of KonaKart => Topic started by: michaelwechner on June 30, 2010, 08:02:07 am

Title: CategoryIf#getProdcuts()
Post by: michaelwechner on June 30, 2010, 08:02:07 am
Hi

Any reason why there isn't a method

CategoryIf#getProducts()

(http://www.konakart.com/javadoc/server/com/konakart/appif/CategoryIf.html)

?

I assume the alternative is

http://www.konakart.com/javadoc/server/com/konakart/appif/KKEngIf.html#getProductsPerCategory(java.lang.String,%20com.konakart.appif.DataDescriptorIf,%20int,%20boolean,%20int)

right?

Thanks

Michael
Title: Re: CategoryIf#getProdcuts()
Post by: michaelwechner on June 30, 2010, 10:52:47 am
I am using now

ProductsIf prods = kkEngine.getProductsPerCategory(null, null, categoryID, true, languageID);

which works very fine, whereas I set "true" in order to make sure to also the products of the sub-categories.

Still I think it would be convenient to have something like

ProductsIf prods = myCategory.getProducts(true);

;-)

Btw, another question I have is re scalability/peformance. It's of returning an array would't it make more sense to return an Iterator (which allows to iterate over the products)?

Thanks

Michael