Пример #1
0
 /**
  * Clean related cache if instance contain layout updates
  */
 protected function _afterSave()
 {
     if ($this->hasDataChanges()) {
         $this->_cleanCache();
     }
     return parent::_afterSave();
 }
 /**
  * Save manufacturer store, after manufacturer save
  *
  * @return Zeon_Manufacturer_Model_Manufacturer
  */
 protected function _afterSave()
 {
     if ($this->hasStoreIds()) {
         $this->_getResource()->saveManufacturerStore($this);
     }
     return parent::_afterSave();
 }
Пример #3
0
 /**
  * After save rule
  * Redeclared for populate rate calculations
  *
  * @return Mage_Tax_Model_Calculation_Rule
  */
 protected function _afterSave()
 {
     parent::_afterSave();
     $this->saveCalculationData();
     AO::dispatchEvent('tax_settings_change_after');
     return $this;
 }
Пример #4
0
 protected function _afterSave()
 {
     //parent::_afterSave($object);
     $mask = Mage::getModel('aitcg/mask')->load($this->getMaskId());
     $filename = $mask->getImagesPath() . 'alpha' . DS . $mask->getFilename();
     $filename_white = $mask->getImagesPath() . 'alpha' . DS . 'white_' . $mask->getFilename();
     $filename_white_pdf = $mask->getImagesPath() . 'alpha' . DS . 'white_pdf_' . $mask->getFilename();
     $filename_black = $mask->getImagesPath() . 'alpha' . DS . 'black_' . $mask->getFilename();
     $path = $this->getImagesPath();
     $filename_new = $path . 'mask_inverted.png';
     $filename_new_white = $path . 'white_mask_inverted.png';
     $filename_new_black = $path . 'black_mask_inverted.png';
     $filename_new_white_pdf = $path . 'white_pdf_mask_inverted.png';
     if (file_exists($filename)) {
         mkdir($path, 0777, true);
         copy($filename, $filename_new);
     }
     if (file_exists($filename_white)) {
         copy($filename_white, $filename_new_white);
     }
     if (file_exists($filename_black)) {
         copy($filename_black, $filename_new_black);
     }
     if (file_exists($filename_white_pdf)) {
         copy($filename_white_pdf, $filename_new_white_pdf);
     }
     //$this->createTumb();
     return parent::_afterSave();
 }
Пример #5
0
 /**
  * Processing object after save data
  * Updates relevant grid table records.
  *
  * @return Mage_Core_Model_Abstract
  */
 protected function _afterSave()
 {
     if (!$this->getForceUpdateGridRecords()) {
         $this->_getResource()->updateGridRecords($this->getId());
     }
     return parent::_afterSave();
 }
Пример #6
0
 /**
  * After save process
  *
  * @return Mage_Catalog_Model_Product_Type_Configurable_Attribute
  */
 protected function _afterSave()
 {
     parent::_afterSave();
     $this->_getResource()->saveLabel($this);
     $this->_getResource()->savePrices($this);
     return $this;
 }
Пример #7
0
 /**
  * Clean cache for front-end menu
  *
  * @return  Mage_Core_Model_Url_Rewrite
  */
 protected function _afterSave()
 {
     if ($this->hasCategoryId()) {
         $this->_cacheTag = array(Mage_Catalog_Model_Category::CACHE_TAG, Mage_Core_Model_Store_Group::CACHE_TAG);
     }
     parent::_afterSave();
     return $this;
 }
Пример #8
0
 protected function _afterSave()
 {
     foreach ($this->getRateDataCollection() as $dataModel) {
         $dataModel->setTaxRateId($this->getId());
         $dataModel->save();
     }
     parent::_afterSave();
 }
Пример #9
0
 protected function _afterSave()
 {
     if (is_string($this->getGuiData())) {
         $this->setGuiData(unserialize($this->getGuiData()));
     }
     Mage::getModel('core/convert_history')->setProfileId($this->getId())->setActionCode($this->getOrigData('profile_id') ? 'update' : 'create')->save();
     parent::_afterSave();
 }
Пример #10
0
 protected function _afterSave()
 {
     if (Mage::registry('amorderattach_add_field')) {
         $data = array('code' => $this->getCode(), 'type' => $this->getType(), 'apply_to_each_product' => $this->getApplyToEachProduct());
         Mage::register('amorderattach_additional_data', $data);
     }
     return parent::_afterSave();
 }
 /**
  * Processing object after save data
  *
  * @return Maverick_Crawler_Model_Crawler
  */
 protected function _afterSave()
 {
     parent::_afterSave();
     if ($type = $this->getType()) {
         Mage::dispatchEvent($type . '_save_after', $this->_getEventData());
     }
     return $this;
 }
Пример #12
0
 /**
  * @return Firegento_FlexCms_Model_Content_Data
  */
 protected function _afterSave()
 {
     /** @var Firegento_FlexCms_Model_Content_Data $contentData */
     $contentData = $this->getContentDataModel();
     $contentData->setContent($this->getContent());
     $contentData->setIsActive($this->getIsActive());
     $contentData->save();
     return parent::_afterSave();
 }
Пример #13
0
 /**
  * Create/update/delete file after save
  * Delete file if only file is empty
  *
  * @return Mage_Core_Model_Theme_Files
  */
 protected function _afterSave()
 {
     if ($this->getContent()) {
         $this->_saveFile();
     } else {
         $this->_deleteFile();
     }
     return parent::_afterSave();
 }
Пример #14
0
 /**
  * Rewrite _afterSave
  * 
  * @return \Magestore_Inventorysupplyneeds_Model_Draftpo
  */
 protected function _afterSave()
 {
     parent::_afterSave();
     if ($this->getIsUpdateMode()) {
         $this->_removeUncheckProducts();
         $this->_addProducts();
     }
     return $this;
 }
 public function _afterSave()
 {
     if (!$this->getVendorPrefix()) {
         $this->getResource()->_saveVendorPrefix($this);
     }
     if (sizeof($this->getStaticPages()) == 0) {
         $this->createDefaultPage();
     }
     return parent::_afterSave();
 }
Пример #16
0
 /**
  * there is no afterCommitCallback on earlier
  * versions, use the closest alternative
  */
 protected function _afterSave()
 {
     if (version_compare(Mage::getVersion(), '1.4.0.0', '<')) {
         if (!$this->getNoCMB()) {
             //ping Jirafe
             Mage::getSingleton('foomanjirafe/jirafe')->sendCMB($this->getSiteId());
         }
         return parent::_afterSave();
     }
 }
Пример #17
0
 /**
  * "After save" actions
  *
  * @return Mage_Oauth_Model_Nonce
  */
 protected function _afterSave()
 {
     parent::_afterSave();
     //Cleanup old entries
     /** @var $helper Mage_Oauth_Helper_Data */
     $helper = Mage::helper('oauth');
     if ($helper->isCleanupProbability()) {
         $this->_getResource()->deleteOldEntries($helper->getCleanupExpirationPeriod());
     }
     return $this;
 }
Пример #18
0
     if (is_object($controller)) {
         $this->setController(get_class($controller) . '::' . $controller->getRequest()->getActionName());
     }
     return parent::_beforeSave();
 }
 protected function _afterSave()
 {
     if (null !== $this->getCorrespondents()) {
         foreach ($this->getCorrespondents() as $correspondent) {
             if (!$correspondent->getId()) {
                 $correspondent->setSentemailId($this->getId());
                 $correspondent->save();
Пример #19
0
 protected function _afterSave()
 {
     parent::_afterSave();
     if ($this->getId()) {
         $options = $this->getOptions();
         foreach ($options as $info) {
             $color = Mage::getModel('adjicon/color');
             /* @var $icon AdjustWare_Icon_Model_Icon */
             $color->load($info['color_id'])->saveColor($info);
         }
     }
     return $this;
 }
Пример #20
0
 /**
  * Processing object after save data
  *
  * @return Mage_Bundle_Model_Selection
  */
 protected function _afterSave()
 {
     $storeId = Mage::registry('product')->getStoreId();
     if (!Mage::helper('catalog')->isPriceGlobal() && $storeId) {
         $this->setWebsiteId(Mage::app()->getStore($storeId)->getWebsiteId());
         $this->getResource()->saveSelectionPrice($this);
         if (!$this->getDefaultPriceScope()) {
             $this->unsSelectionPriceValue();
             $this->unsSelectionPriceType();
         }
     }
     parent::_afterSave();
 }
Пример #21
0
 protected function _afterSave()
 {
     if (is_array($cache = @unserialize($this->getData('cache')))) {
         $this->setData('cache', $cache);
     } else {
         $this->setData('cache', null);
     }
     if (is_array($variables = @unserialize($this->getData('custom_variables')))) {
         $this->setData('custom_variables', $variables);
     } else {
         $this->setData('custom_variables', null);
     }
     return parent::_afterSave();
 }
Пример #22
0
 protected function _afterSave()
 {
     if ($this->getData('rewrite_generated')) {
         return parent::_afterSave();
     }
     $rewrite = Mage::getModel('core/url_rewrite')->load($this->getRewriteId());
     $rewrite->setStoreId($this->getStoreId())->setData('is_system', 0)->setIdPath('seonavigation/' . $this->getId())->setTargetPath($this->prepareTargetPath());
     $urlSuffix = '';
     $params = unserialize($this->getQueryParams());
     $storeId = isset($params['store']) ? $params['store'] : Mage::app()->getStore()->getId();
     if ($params['id']) {
         $urlSuffix = Mage::getStoreConfig('catalog/seo/category_url_suffix', $storeId);
     }
     if ($params['q']) {
         $urlSuffix = Mage::helper('seoplus')->getConfig('url_suffix');
     }
     $length = strrpos($this->getClearUrl(), $urlSuffix);
     if ($urlSuffix && $length && $length + strlen($urlSuffix) == strlen($this->getClearUrl())) {
         $requestPath = substr($this->getClearUrl(), 0, $length);
     } else {
         $requestPath = $this->getClearUrl();
     }
     $requestPath .= $this->getUrlKey();
     $continue = true;
     while ($continue) {
         $existedRewrite = Mage::getResourceModel('core/url_rewrite_collection')->addFieldToFilter('request_path', $requestPath . $urlSuffix)->addFieldToFilter('store_id', $rewrite->getStoreId())->getFirstItem();
         //Fix CMS
         $cmsRewrite = Mage::getResourceModel('cms/page_collection')->addFieldToFilter('identifier', $requestPath . $urlSuffix)->getFirstItem()->getPageId();
         if ($existedRewrite->getId() && $existedRewrite->getId() != $rewrite->getId() || $cmsRewrite) {
             $requestPath .= '-' . $this->getId();
         } else {
             $continue = false;
         }
     }
     $requestPath .= $urlSuffix;
     $rewrite->setData('request_path', $requestPath);
     try {
         $rewrite->save();
         $this->setRequestPath($requestPath)->setRewriteId($rewrite->getId())->setData('rewrite_generated', true)->save();
     } catch (Exception $e) {
     }
     return parent::_afterSave();
 }
Пример #23
0
 protected function _afterSave()
 {
     parent::_afterSave();
     // Create code for Referer
     if ($this->getData('refer_user') && $this->getData('refer_email') && intval($this->_getDataHelper()->getReferConfig('user_per_code')) > 0 && $this->getData('status') == self::STATUS_PENDING) {
         $program = $this->getProgram();
         $programId = $program->getId();
         /* total code of the referer */
         $refererCodes = $this->getCollectionByProgramEmail($programId, $this->getData('refer_email'));
         /* total referal of referer */
         $referralList = $this->getCollection()->addFieldToFilter('refer_user', $this->getData('refer_user'))->addFieldToFilter('refer_email', $this->getData('refer_email'))->addFieldToFilter('status', self::STATUS_PENDING);
         $userPerCode = intval($this->_getDataHelper()->getReferConfig('user_per_code'));
         if ($referralList->count() / $userPerCode >= $refererCodes->count() && $refererCodes->count()) {
             $code = $refererCodes->getFirstItem();
             $referCode = Mage::getModel('luckydraw/code');
             $referCode->setData(array('program_id' => $programId, 'customer_id' => $code->getData('customer_id'), 'name' => $code->getData('name'), 'email' => $code->getData('email'), 'address_id' => $code->getData('address_id'), 'created_time' => now(), 'status' => Magestore_Luckydraw_Model_Code::STATUS_PENDING, 'credit_rate' => $program->getData('credit_rate'), 'program' => $program))->save();
             $referCode->sendReferEmail();
         }
     }
     return $this;
 }
Пример #24
0
 protected function _afterSave()
 {
     if ($storeId = $this->getStoreId()) {
         $storeAttributes = $this->getStoreAttributes();
         foreach ($storeAttributes as $attribute) {
             $attributeValue = Mage::getModel('bannerslider/value')->loadAttributeValue($this->getId(), $storeId, $attribute);
             if ($this->getData($attribute . '_in_store')) {
                 try {
                     $attributeValue->setValue($this->getData($attribute . '_value'))->save();
                 } catch (Exception $e) {
                 }
             } elseif ($attributeValue && $attributeValue->getId()) {
                 try {
                     $attributeValue->delete();
                 } catch (Exception $e) {
                 }
             }
         }
     }
     return parent::_afterSave();
 }
Пример #25
0
 protected function _afterSave()
 {
     if (is_string($this->getGuiData())) {
         $this->setGuiData(unserialize($this->getGuiData()));
     }
     Mage::getModel('dataflow/profile_history')->setProfileId($this->getId())->setActionCode($this->getOrigData('profile_id') ? 'update' : 'create')->save();
     if (isset($_FILES['file_1']['tmp_name']) || isset($_FILES['file_2']['tmp_name']) || isset($_FILES['file_3']['tmp_name'])) {
         for ($index = 0; $index < 3; $index++) {
             if ($file = $_FILES['file_' . ($index + 1)]['tmp_name']) {
                 $uploader = new Varien_File_Uploader('file_' . ($index + 1));
                 $uploader->setAllowedExtensions(array('csv', 'xml'));
                 $path = Mage::app()->getConfig()->getTempVarDir() . '/import/';
                 $uploader->save($path);
                 if ($uploadFile = $uploader->getUploadedFileName()) {
                     $newFilename = 'import-' . date('YmdHis') . '-' . ($index + 1) . '_' . $uploadFile;
                     rename($path . $uploadFile, $path . $newFilename);
                 }
             }
         }
     }
     parent::_afterSave();
 }
Пример #26
0
 /**
  * Processing object after save data
  *
  * @return Mage_Core_Model_Abstract
  */
 protected function _afterSave()
 {
     if ($this->hasData('tag_assigned_products')) {
         $tagRelationModel = Mage::getModel('tag/tag_relation');
         $tagRelationModel->addRelations($this, $this->getData('tag_assigned_products'));
     }
     return parent::_afterSave();
 }
Пример #27
0
 /**
  * save religion relation
  *
  * @access public
  * @return Lionleap_Temples_Model_Religion
  * @author Ultimate Module Creator
  */
 protected function _afterSave()
 {
     return parent::_afterSave();
 }
Пример #28
0
 /**
  * After object save
  *
  * @return Mage_Sales_Model_Order_Invoice_Item
  */
 protected function _afterSave()
 {
     if (null == !$this->_orderItem) {
         $this->_orderItem->save();
     }
     parent::_afterSave();
     return $this;
 }
Пример #29
0
 protected function _afterSave()
 {
     parent::_afterSave();
     if ($this->_commonHelper()->isSearchCoreEnabled()) {
         $this->_afterSaveIndexerProcess();
     }
 }
Пример #30
0
 /**
  * Processing object after save data
  *
  * @return Mage_XmlConnect_Model_Application
  */
 protected function _afterSave()
 {
     $this->_saveConfigData();
     $this->_saveDeprecatedConfig();
     parent::_afterSave();
     return $this;
 }