/**
  * save crm settings
  * 
  * @param Crm_Model_Config $_settings
  * @return Crm_Model_Config
  * 
  * @todo generalize this
  */
 public function saveConfigSettings($_settings)
 {
     if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) {
         Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ . ' Updating Crm Settings: ' . print_r($_settings->toArray(), TRUE));
     }
     foreach ($_settings->toArray() as $field => $value) {
         if ($field == 'id') {
             continue;
         } else {
             if ($field == 'defaults') {
                 parent::saveConfigSettings($value);
             } else {
                 Crm_Config::getInstance()->set($field, $value);
             }
         }
     }
     // invalidate cache
     Tinebase_Core::getCache()->remove('getCrmSettings');
     Crm_Config::getInstance()->clearCache();
     return $this->getConfigSettings();
 }
Example #2
0
 /**
  * save crm settings
  * 
  * @param Crm_Model_Config $_settings
  * @return Crm_Model_Config
  * 
  * @todo generalize this
  */
 public function saveConfigSettings($_settings)
 {
     if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) {
         Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ . ' Updating Crm Settings: ' . print_r($_settings->toArray(), TRUE));
     }
     foreach ($_settings->toArray() as $field => $value) {
         if ($field == 'id') {
             continue;
         } else {
             if ($field == 'defaults') {
                 parent::saveConfigSettings($value);
             } else {
                 Tinebase_Config::getInstance()->setConfigForApplication($field, Zend_Json::encode($value), $this->_applicationName);
             }
         }
     }
     // invalidate cache
     Tinebase_Core::get('cache')->clean(Zend_Cache::CLEANING_MODE_MATCHING_TAG, array('settings'));
     return $this->getConfigSettings();
 }