Hallo,
ich möchte den Baum einer bestimmten Kategorie haben:
class smx_oxviewconfig extends smx_oxviewconfig_parent
{
public function getBaumuster()
{
$myConfig = $this->getConfig();
$sCatID = $myConfig->getConfigParam('sBaumusterCatId');
$oCat = oxNew('oxcategory');
$oCat->load($sCatID);
$oSubCat = $oCat->getSubCats();
return $oSubCat;
} //function
}
Die Kategorie ist so aufgebaut (und alle korrekt angelegt mit Artikeln, aktiv
usw):
Hauptkategorie (sBaumusterCatId)
- Unter 1
-- Unterunter 1
-- Unterunter 2
- Unter 2
- Unter 3
Das soll auch im Template verfügbar sein über [{assign var="obm"
value=$oViewConf->getBaumuster()}]. Leider gibt das getSubCats immer ein leeres
Array zurück. Was fehlt ihm hier, was muss nach load() noch folgen?
Das Objekt $oCat sieht auch OK aus, es fehlen nur die Subcats:
smx_oxcategory Object
(
[_aSubCats:protected] => Array
(
)
[_aContentCats:protected] => Array
(
)
[_sClassName:protected] => oxcategory
[_iNrOfArticles:protected] =>
[_blIsVisible:protected] =>
[_blExpanded:protected] =>
[_blHasSubCats:protected] =>
[_blHasVisibleSubCats:protected] =>
[_blIsSeoObject:protected] => 1
[_blUseLazyLoading:protected] =>
[_sDynImageDir:protected] =>
[_blTopCategory:protected] =>
[_aIds:protected] => Array
(
)
[_aStdUrls:protected] => Array
(
)
[_aSeoUrls:protected] => Array
(
)
[_iLanguage:protected] => 0
[_blEmployMultilanguage:protected] => 1
[_sOXID:protected] => 214e377cb795b8a7e473188a78abd024
[_iShopId:protected] => 1
[_blIsSimplyClonable:protected] => 1
[_aErrors:protected] => Array
(
)
[_sCoreTable:protected] => oxcategories
[_sViewTable:protected] =>
[_blForceCoreTableUsage:protected] =>
[_blDisableShopCheck:protected] => 1
[_aFieldNames:protected] => Array
(
[oxid] => 0
[oxparentid] => 0
[oxleft] => 0
[oxright] => 0
[oxrootid] => 0
[oxsort] => 0
[oxactive] => 1
[oxhidden] => 0
[oxshopid] => 0
[oxshopincl] => 0
[oxshopexcl] => 0
[oxtitle] => 1
[oxdesc] => 1
[oxlongdesc] => 1
[oxthumb] => 1
[oxextlink] => 0
[oxtemplate] => 0
[oxdefsort] => 0
[oxdefsortmode] => 0
[oxpricefrom] => 0
[oxpriceto] => 0
[oxicon] => 0
[oxpromoicon] => 0
[oxvat] => 0
[oxskipdiscounts] => 0
[oxshowsuffix] => 0
[smxbaumuster] => 0
)
[_blIsNewCache:protected] =>
[_sCacheKey:protected] => allviews_i18n
[_aSkipSaveFields:protected] => Array
(
)
[_sExistKey:protected] => oxid
[_blIsDerived:protected] =>
[_blReadOnly:protected] =>
[_blIsInList:protected] =>
[_isLoaded:protected] => 1
[_aInnerLazyCache:protected] =>
[oxcategories__oxid] => oxField Object
(
[value] => 214e377cb795b8a7e473188a78abd024
)
[oxcategories__oxparentid] => oxField Object
(
[rawValue] => oxrootid
)
[oxcategories__oxleft] => oxField Object
(
[rawValue] => 1
)
[oxcategories__oxright] => oxField Object
(
[rawValue] => 198
)
[oxcategories__oxrootid] => oxField Object
(
[rawValue] => 214e377cb795b8a7e473188a78abd024
)
[oxcategories__oxsort] => oxField Object
(
[rawValue] => -1
)
[oxcategories__oxactive] => oxField Object
(
[rawValue] => 1
)
[oxcategories__oxhidden] => oxField Object
(
[rawValue] => 0
)
[oxcategories__oxshopid] => oxField Object
(
[value] => 1
)
[oxcategories__oxshopincl] => oxField Object
(
[rawValue] => 1
)
[oxcategories__oxshopexcl] => oxField Object
(
[rawValue] => 0
)
[oxcategories__oxtitle] => oxField Object
(
[rawValue] => Baumuster
)
[oxcategories__oxdesc] => oxField Object
(
[rawValue] => Sammelkategorie für Baumuster Baum
)
[oxcategories__oxlongdesc] => oxField Object
(
[value] =>
)
[oxcategories__oxthumb] => oxField Object
(
[rawValue] =>
)
[oxcategories__oxextlink] => oxField Object
(
[rawValue] =>
)
[oxcategories__oxtemplate] => oxField Object
(
[rawValue] =>
)
[oxcategories__oxdefsort] => oxField Object
(
[rawValue] =>
)
[oxcategories__oxdefsortmode] => oxField Object
(
[rawValue] => 0
)
[oxcategories__oxpricefrom] => oxField Object
(
[rawValue] => 0
)
[oxcategories__oxpriceto] => oxField Object
(
[rawValue] => 0
)
[oxcategories__oxicon] => oxField Object
(
[rawValue] =>
)
[oxcategories__oxpromoicon] => oxField Object
(
[rawValue] =>
)
[oxcategories__oxvat] => oxField Object
(
[rawValue] =>
)
[oxcategories__oxskipdiscounts] => oxField Object
(
[rawValue] => 0
)
[oxcategories__oxshowsuffix] => oxField Object
(
[rawValue] => 0
)
[oxcategories__smxbaumuster] => oxField Object
(
[rawValue] => 0
)
)
Viele Grüße
Ralf
_______________________________________________
dev-general mailing list
[email protected]
http://dir.gmane.org/gmane.comp.php.oxid.general