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


PHP Mage_Core_Model_Config_Data::save方法代码示例

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


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

示例1: save

 /**
  * Check request for errors found by Helper and Observer. It will print error messages if errors found and
  * in that case set value to 0.
  *
  * @return FACTFinder_Core_Model_System_Config_Backend_Enabled
  */
 public function save()
 {
     parent::save();
     Mage::app()->cleanCache();
     $this->_checkConfiguration();
     return $this;
 }
开发者ID:KaiStapel,项目名称:Magento-FACTFinder,代码行数:13,代码来源:Enabled.php

示例2: save

 public function save()
 {
     $enabled = $this->getValue();
     //get the value from our config
     $resource = Mage::getSingleton('core/resource');
     $readConnection = $resource->getConnection('core_read');
     $writeConnection = $resource->getConnection('core_write');
     //die($enabled);
     $query = 'SELECT attribute_id FROM eav_attribute WHERE `attribute_code` = \'telephone\'';
     $attribute_id = $readConnection->fetchOne($query);
     $query = 'UPDATE eav_attribute SET `is_required` = \'' . $enabled . '\' WHERE `attribute_code` = \'telephone\'';
     $writeConnection->query($query);
     if ($enabled == 1) {
         $validationRules = 'a:2:{s:15:"max_text_length";i:255;s:15:"min_text_length";i:1;}';
         $query = 'UPDATE customer_eav_attribute SET `validate_rules` = \'' . $validationRules . '\' WHERE `attribute_id` = \'' . $attribute_id . '\'';
         $writeConnection->query($query);
     } else {
         $query = 'UPDATE customer_eav_attribute SET `validate_rules` = NULL WHERE `attribute_id` = \'' . $attribute_id . '\'';
         $writeConnection->query($query);
     }
     //die($attribute_id);
     return parent::save();
     //call original save method so whatever happened
     //before still happens (the value saves)
 }
开发者ID:EliasKotlyar,项目名称:Twinsen_NoTelephoneRequired,代码行数:25,代码来源:EnableTelephone.php

示例3: save

 /**
  * Perform API call to Amazon to validate Client ID/Secret
  *
  */
 public function save()
 {
     $data = $this->getFieldsetData();
     $isEnabled = $this->getValue();
     if ($data['client_id'] && $data['client_secret']) {
         $_api = Mage::getModel('amazon_login/api');
         // REST API params
         $params = array('grant_type' => 'authorization_code', 'code' => 'SplxlOBeZQQYbYS6WxSbIA', 'client_id' => trim($data['client_id']), 'client_secret' => trim($data['client_secret']));
         $response = $_api->request('auth/o2/token', $params);
         if (!$response) {
             Mage::getSingleton('core/session')->addError('Error: Unable to perform HTTP request to Amazon API.');
         } else {
             if ($response && isset($response['error'])) {
                 if ($response['error'] == 'invalid_client') {
                     Mage::getSingleton('core/session')->addError('Client authentication failed. Please verify your Client ID and Client Secret.');
                     $this->setValue(0);
                     // Set "Enabled" to "No"
                 } else {
                     Mage::getSingleton('core/session')->addSuccess('Successfully connected to Amazon API with Client ID and Client Secret.');
                 }
             }
         }
     }
     return parent::save();
 }
开发者ID:frognrainbow,项目名称:amazon-payments-magento-plugin,代码行数:29,代码来源:Enabled.php

示例4: save

 public function save()
 {
     $fdata = array();
     foreach ($this->groups['account']['fields'] as $name => $field) {
         $fdata[$name] = $field['value'];
     }
     if ($fdata['embed']) {
         $obj = json_decode($fdata['embed']);
         $fdata['embed'] = $obj->embed;
         $fdata['guid'] = $obj->guid;
     }
     include_once dirname(__FILE__) . '/JustunoAccess.php';
     $params = array('apiKey' => JUSTUNO_KEY, 'email' => $fdata['email'], 'domain' => $fdata['domain'], 'guid' => $fdata['guid']);
     if ($fdata['password']) {
         $params['password'] = $fdata['password'];
     }
     $jAccess = new JustunoAccess($params);
     try {
         $justuno = $jAccess->getWidgetConfig();
         $jusdata = array();
         $jusdata['dashboard'] = (string) $jAccess->getDashboardLink();
         $jusdata['guid'] = (string) $justuno['guid'];
         $jusdata['embed'] = (string) $justuno['embed'];
         $this->setValue((string) json_encode($jusdata));
     } catch (JustunoAccessException $e) {
         Mage::throwException($e->getMessage());
     }
     return parent::save();
 }
开发者ID:billadams,项目名称:forever-frame,代码行数:29,代码来源:Embed.php

示例5: save

 public function save()
 {
     if ($value = $this->getValue()) {
         $value = implode(',', array_unique(explode(',', $this->getValue())));
     }
     $this->setValue($value);
     return parent::save();
 }
开发者ID:sixg,项目名称:mkAnagh,代码行数:8,代码来源:Category.php

示例6: save

 function save()
 {
     if ($this->getFieldsetDataValue('active')) {
         $merchantId = $this->getFieldsetDataValue("merchant_id");
         Litle_CreditCard_Model_ValidateMerchantId::validate($merchantId);
     }
     return parent::save();
 }
开发者ID:nengineer,项目名称:litle-integration-magento,代码行数:8,代码来源:ValidateMerchantId.php

示例7: save

 public function save()
 {
     if (!Mage::getModel($this->getValue())) {
         Mage::throwException(sprintf('Invalid Access Class: Could not instantiate a [%s]', $this->getValue()));
     } else {
         parent::save();
     }
 }
开发者ID:CE-Webmaster,项目名称:CE-Hub,代码行数:8,代码来源:Configaccessclass.php

示例8: save

 /**
  * Disable saving if multiselect fields are disabled
  * 
  * @return $this|Mage_Core_Model_Abstract
  */
 public function save()
 {
     $helper = Mage::helper('netzarbeiter_groupscatalog2');
     if ($helper->getConfig('show_multiselect_field')) {
         parent::save();
     }
     return $this;
 }
开发者ID:aniljaiswal,项目名称:order-confirmation,代码行数:13,代码来源:Abstract.php

示例9: save

 public function save()
 {
     $v = $this->getValue();
     if ($v == 'rgba(0, 0, 0, 0)') {
         $this->setValue('transparent');
     }
     return parent::save();
 }
开发者ID:roshu1980,项目名称:add-computers,代码行数:8,代码来源:Color.php

示例10: save

 public function save()
 {
     $value = $this->getValue();
     if ($value && !is_numeric($value)) {
         Mage::throwException("Fields specifying 'Numeric' must have numeric values only!");
     }
     return parent::save();
 }
开发者ID:Aerotexextintores,项目名称:novosite,代码行数:8,代码来源:Numeric.php

示例11: save

 public function save()
 {
     // Validate number. Should be a whole number greater than 0.
     if (!ctype_digit((string) $this->getValue()) || (int) $this->getValue() <= 0) {
         Mage::throwException("Invalid entry for attempts. Must be a positive whole number, such as 20");
     }
     return parent::save();
 }
开发者ID:ankita-parashar,项目名称:magento,代码行数:8,代码来源:Gorilla_Greatplains_Model_System_Config_Backend_Attempts.php

示例12: save

 public function save()
 {
     // Validate email. Do not allow invalid emails
     if (!Zend_Validate::is($this->getValue(), 'EmailAddress')) {
         Mage::throwException("Invalid email format. Recipient and sender emails must be valid emails");
     }
     return parent::save();
 }
开发者ID:ankita-parashar,项目名称:magento,代码行数:8,代码来源:Gorilla_Greatplains_Model_System_Config_Backend_Email.php

示例13: save

 /**
  * Checks the entered value before saving it to the configuration. Setting to default (DE only) if
  * another country than Germany was choosen.
  *
  * @return Mage_Core_Model_Abstract
  */
 public function save()
 {
     if ($this->getValue() != '1') {
         $translateMessage = Mage::helper('barzahlen')->__('bz_adm_specificcountry_exception');
         Mage::getSingleton('adminhtml/session')->addError($translateMessage);
         Mage::helper('barzahlen')->bzLog('adminexceptions/country: Setting DE as allowed country');
         $this->setValue(1);
     }
     return parent::save();
 }
开发者ID:KaiBerkemeyer,项目名称:Barzahlen-Magento-1,代码行数:16,代码来源:Allspecificcountries.php

示例14: save

 public function save()
 {
     $group = $this->getData('groups');
     $fields = $group['messages']['fields'];
     if ($fields['activate']['value'] == 1) {
         if ($fields['mode']['value'] == 1) {
             $productionpublickey = $fields['productionpublickey']['value'];
             $productionprikey = $fields['productionprikey']['value'];
             if ($productionpublickey == NULL || $productionpublickey == ' ' || !isset($productionpublickey)) {
                 Mage::throwException(Mage::helper('core')->__('Production Public key is required'));
                 die;
             }
             if ($productionprikey == NULL || $productionprikey == ' ' || !isset($productionprikey)) {
                 Mage::throwException(Mage::helper('core')->__('Production Private key is required'));
                 die;
             }
             if (strlen($productionpublickey) != 11) {
                 Mage::throwException(Mage::helper('core')->__('Public key lenth must be 11 characters'));
                 die;
             }
             if (strlen($productionprikey) != 21) {
                 Mage::throwException(Mage::helper('core')->__('Private key length must be 21 characters'));
                 die;
             }
             if (substr($productionprikey, 0, 1) != "P" || substr($productionpublickey, 0, 1) != "P") {
                 Mage::throwException(Mage::helper('core')->__('Please enter a valid Production key'));
                 die;
             }
         } elseif ($fields['mode']['value'] == 0) {
             $sandboxpublickey = $fields['sandboxpublickey']['value'];
             $sandboxprikey = $fields['sandboxprikey']['value'];
             if ($sandboxpublickey == NULL || $sandboxpublickey == ' ' || !isset($sandboxpublickey)) {
                 Mage::throwException(Mage::helper('core')->__('Sandbox Public key is required'));
                 die;
             }
             if ($sandboxprikey == NULL || $sandboxprikey == ' ' || !isset($sandboxprikey)) {
                 Mage::throwException(Mage::helper('core')->__('Sandbox Private key is required'));
                 die;
             }
             if (strlen($sandboxpublickey) != 11) {
                 Mage::throwException(Mage::helper('core')->__('Public key lenth must be 11 characters'));
                 die;
             }
             if (strlen($sandboxprikey) != 21) {
                 Mage::throwException(Mage::helper('core')->__('Private key length must be 21 characters'));
                 die;
             }
             if (substr($sandboxprikey, 0, 1) != "T" || substr($sandboxpublickey, 0, 1) != "T") {
                 Mage::throwException(Mage::helper('core')->__('Please enter a valid Sandbox key'));
                 die;
             }
         }
     }
     return parent::save();
 }
开发者ID:bvzdigital,项目名称:magento,代码行数:55,代码来源:Save.php

示例15: save

 /**
  * Checks the entered value before saving it to the configuration. Setting to default if string
  * length is lower than 1.
  *
  * @return Mage_Core_Model_Abstract
  */
 public function save()
 {
     $title = $this->getValue();
     if (strlen($title) < 1) {
         $translateMessage = Mage::helper('barzahlen')->__('bz_adm_co_exception');
         Mage::getSingleton('adminhtml/session')->addError($translateMessage);
         Mage::helper('barzahlen')->bzLog('adminexceptions/title: Empty string given. Setting default title.');
         $this->setValue('Barzahlen');
     }
     return parent::save();
 }
开发者ID:KaiBerkemeyer,项目名称:Barzahlen-Magento-1,代码行数:17,代码来源:Title.php


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