public function save() { $db = JFactory::getDBO(); // Perform custom validation of config data before we write it. $this->check(); // Get current configuration $params = $this->getProperties(); unset($params['id']); $db->setQuery("REPLACE INTO #__kunena_configuration SET id=1, params={$db->quote(json_encode($params))}"); $db->query(); KunenaError::checkDatabaseError(); // Clear cache. KunenaCacheHelper::clear(); }
/** * @see KunenaDatabaseObject::saveInternal() */ protected function saveInternal() { // Reorder categories $table = $this->getTable(); $table->bind($this->getProperties()); $table->exists($this->_exists); // Update alias $success = $this->addAlias($this->get('alias')); if ($success) { $this->_alias = $this->alias; } // TODO: remove this hack... if (!isset($this->_noreorder)) { $table->reorder(); $this->ordering = $table->ordering; unset($this->_noreorder); } // Clear cache $access = KunenaAccess::getInstance(); $access->clearCache(); KunenaCacheHelper::clear(); return true; }