public function getRootCategoryId()
{
if (-1 === self::$_rootCategoryId) {
$collection = Mage::getResourceModel('catalog/category_collection');
$collection->addFieldToFilter('parent_id', 0);
$collection->getSelect()->limit(1);
$rootCategory = $collection->getFirstItem();
self::$_rootCategoryId = $rootCategory->getId();
}
return self::$_rootCategoryId;
}