Esempio n. 1
0
 protected function _afterSave()
 {
     $result = parent::_afterSave();
     Mage::getSingleton('index/indexer')->processEntityAction($this, self::ENTITY, Mage_Index_Model_Event::TYPE_SAVE);
     return $result;
 }
Esempio n. 2
0
 protected function _afterSave()
 {
     if (!$this->getPath() && $this->getPageId()) {
         if (!$this->getPosition()) {
             $this->setPosition($this->getPageId());
         }
         $path = '';
         if ($this->getParentId()) {
             $parent = $this->getParentPage();
             $path = $parent->getPath();
         }
         $path .= '/' . $this->getPageId();
         $path = trim($path, '/');
         $this->setPath($path)->setLevel(count(explode('/', $path)))->save();
     }
     if ($this->getCreateDefaultPermission()) {
         $storeId = $this->getStoreId();
         $customerGroupId = Mage_Customer_Model_Group::NOT_LOGGED_IN_ID;
         $resourceModel = Mage::getResourceModel('cms/page_permission');
         if ($this->isRoot() || $resourceModel->exists($storeId, $customerGroupId, $this->getParentId())) {
             Mage::getModel('cms/page_permission')->addData(array('store_id' => $storeId, 'customer_group_id' => $customerGroupId, 'page_id' => $this->getPageId()))->save();
         }
         $this->setCreateDefaultPermission(false);
     }
     return parent::_afterSave();
 }