Hi everybody,
I have a general question regarding OXID's implementation of DB-Object lazy
loading.
My scenario is the following:
I want to render a list of all the top level categories on the shop's start
view. I basically use the following code to achieve this:
[{foreach from=$oxcmp_categories item="category"}]
[{* render HTML to display category using $category object *}]
[{/foreach}]
So far, this works as it should, however when I try to access a category's
promo icon (using the method oxCategory::getPromotionIconUrl()), no URL is
returned, although I uploaded the respective icon using the admin interface.
I investigated this issue a little further and discovered, that the
$oxcmp_categories object is constructed using the method
oxCategoryList::buildTree() which does NOT load the oxpromoicon field for very
category. BUT, as far as my understanding of lazy loading goes, the respective
field should be loaded automatically, when it is accessed, but not already
loaded.
I hope someone can elaborate a little bit on this topic, how the lazy loading
feature in OXID works and how one has to use it. Also, for a scenario like
mine, what would be the best practice to get the URL I'm interested in.
Thank you in advance!
Best regards
Dipl.-Ing. (FH) Michael Zender
Development eCommerce
Technical Project Lead
MOS-TANGRAM AG
Wohlerstrasse 2
CH-5623 Boswil
Phone: +41 (0)56 677 82 20
Fax: +41 (0)56 677 82 99
E-Mail: [email protected]<mailto:[email protected]>
Internet: http://www.mos-tangram.com<http://www.mos-tangarm.com/>
_______________________________________________
dev-general mailing list
[email protected]
http://dir.gmane.org/gmane.comp.php.oxid.general