コード例 #1
0
 /**
  * Returns instance of Tinebase_Config
  *
  * @return Tinebase_Config
  */
 public static function getInstance()
 {
     if (self::$_instance === NULL) {
         self::$_instance = new self();
     }
     return self::$_instance;
 }
コード例 #2
0
 /**
  * save SimpleFAQ settings
  *
  * @param SimpleFAQ_Model_Config $_settings
  * @return SimpleFAQ_Model_Config
  *
  * @todo generalize this
  */
 public function saveConfigSettings($_settings)
 {
     if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) {
         Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ . ' Updating SimpleFAQ Settings: ' . print_r($_settings->toArray(), TRUE));
     }
     foreach ($_settings->toArray() as $field => $value) {
         if ($field == 'id') {
             continue;
         } else {
             if ($field == 'defaults') {
                 parent::saveConfigSettings($value);
             } else {
                 SimpleFAQ_Config::getInstance()->set($field, $value);
             }
         }
     }
     // invalidate cache
     Tinebase_Core::get('cache')->clean(Zend_Cache::CLEANING_MODE_MATCHING_TAG, array('settings'));
     return $this->getConfigSettings();
 }