Mage_Adminhtml_Model_System_Config_Backend_Category Class Reference

Inheritance diagram for Mage_Adminhtml_Model_System_Config_Backend_Category:

Mage_Core_Model_Config_Data Mage_Core_Model_Abstract Varien_Object

List of all members.

Protected Member Functions

 _afterSave ()


Detailed Description

Definition at line 34 of file Category.php.


Member Function Documentation

_afterSave (  )  [protected]

Processing object after save data

Returns:
Mage_Core_Model_Abstract

Reimplemented from Mage_Core_Model_Abstract.

Definition at line 36 of file Category.php.

00037     {
00038         if ($this->getScope() == 'stores') {
00039             $rootId     = $this->getValue();
00040             $storeId    = $this->getScopeId();
00041 
00042             $category   = Mage::getSingleton('catalog/category');
00043             $tree       = $category->getTreeModel();
00044 
00045             // Create copy of categories attributes for choosed store
00046             $tree->load();
00047             $root = $tree->getNodeById($rootId);
00048 
00049             // Save root
00050             $category->setStoreId(0)
00051                ->load($root->getId());
00052             $category->setStoreId($storeId)
00053                 ->save();
00054 
00055             foreach ($root->getAllChildNodes() as $node) {
00056                 $category->setStoreId(0)
00057                    ->load($node->getId());
00058                 $category->setStoreId($storeId)
00059                     ->save();
00060             }
00061         }
00062         return $this;
00063     }


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:23:13 2009 for Magento by  doxygen 1.5.8