当前位置: 首页>>代码示例>>PHP>>正文


PHP Mage_Core_Model_Email_Template::getData方法代码示例

本文整理汇总了PHP中Mage_Core_Model_Email_Template::getData方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Core_Model_Email_Template::getData方法的具体用法?PHP Mage_Core_Model_Email_Template::getData怎么用?PHP Mage_Core_Model_Email_Template::getData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mage_Core_Model_Email_Template的用法示例。


在下文中一共展示了Mage_Core_Model_Email_Template::getData方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: afterSave

 public function afterSave(Mage_Core_Model_Email_Template $template)
 {
     if (true !== Mage::registry('aitemails_template_save_noaddconfig')) {
         $template_data = $template->getData();
         $this->_addToConfig($template, $template_data['orig_template_code']);
     }
     $oReq = Mage::app()->getFrontController()->getRequest();
     /**
      * saving attachments
      */
     if ($data = $oReq->getPost('aitemails')) {
         if (isset($data['aitattachment'])) {
             $_deleteItems = array();
             foreach ($data['aitattachment'] as $aitattachmentItem) {
                 if ($aitattachmentItem['is_delete'] == '1') {
                     if ($aitattachmentItem['aitattachment_id']) {
                         $_deleteItems[] = $aitattachmentItem['aitattachment_id'];
                     }
                 } else {
                     $aitattachmentModel = Mage::getModel('aitemails/aitattachment');
                     $files = array();
                     if (isset($aitattachmentItem['file'])) {
                         $files = Zend_Json::decode($aitattachmentItem['file']);
                     }
                     $aitattachmentModel->setData($aitattachmentItem)->setAttachmentType($aitattachmentItem['type'])->setTemplateId($template->getId())->setStoreId(0);
                     /* If file is new - its id = 0 */
                     if ($aitattachmentItem['aitattachment_id'] != 0) {
                         $aitattachmentModel->setAttachmentId($aitattachmentItem['aitattachment_id']);
                     }
                     if ($aitattachmentModel->getAttachmentType() == Mage_Downloadable_Helper_Download::LINK_TYPE_FILE) {
                         $aitattachmentFileName = Mage::helper('downloadable/file')->moveFileFromTmp($aitattachmentModel->getBaseTmpPath(), $aitattachmentModel->getBasePath(), $files);
                         $aitattachmentModel->setAttachmentFile($aitattachmentFileName);
                     }
                     $aitattachmentModel->save();
                 }
             }
             if ($_deleteItems) {
                 Mage::getResourceModel('aitemails/aitattachment')->deleteItems($_deleteItems);
             }
         }
     }
 }
开发者ID:kiutisuperking,项目名称:eatsmartboxdev,代码行数:42,代码来源:CoreMysql4EmailTemplate.php


注:本文中的Mage_Core_Model_Email_Template::getData方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。