public function save() { foreach ($this->getValues() as $k => $v) { $key = opPluginChannelServerPluginConfiguration::CONFIG_KEY_PREFIX . $k; $config = Doctrine::getTable('SnsConfig')->retrieveByName($key); if (!$config) { $config = new SnsConfig(); $config->setName($key); } $config->setValue($v); $config->save(); if (!$v) { $config->delete(); } } }