Exemplo n.º 1
0
 public function save()
 {
     $config = Doctrine::getTable('SnsConfig')->retrieveByName($this->configName);
     if (!$config) {
         $config = new SnsConfig();
         $config->setName($this->configName);
     }
     $config->setValue($this->getValue('ip_list'));
     $config->save();
 }
Exemplo n.º 2
0
 public function save($themeName)
 {
     $snsConfigTable = Doctrine::getTable('SnsConfig')->retrieveByName('Theme_used');
     if (null === $snsConfigTable) {
         $snsConfigTable = new SnsConfig();
         $snsConfigTable->setName('Theme_used');
     }
     $snsConfigTable->setValue($themeName);
     $snsConfigTable->save();
     return true;
 }
Exemplo n.º 3
0
 public function set($name, $value)
 {
     $config = $this->retrieveByName($name);
     if (!$config) {
         $config = new SnsConfig();
         $config->setName($name);
     }
     $config->setValue($value);
     $this->configs[$name] = $config;
     return $config->save();
 }
Exemplo n.º 4
0
 public function save()
 {
     $config = sfConfig::get('openpne_sns_config');
     foreach ($this->getValues() as $key => $value) {
         $snsConfig = Doctrine::getTable('SnsConfig')->retrieveByName($key);
         if (!$snsConfig) {
             $snsConfig = new SnsConfig();
             $snsConfig->setName($key);
         }
         $snsConfig->setValue($value);
         $snsConfig->save();
     }
 }
 public function save()
 {
     foreach ($this->getValues() as $key => $value) {
         $snsConfig = Doctrine::getTable('SnsConfig')->findOneByName($key);
         if (!$snsConfig) {
             $snsConfig = new SnsConfig();
             $snsConfig->setName($key);
         }
         $snsConfig->setValue($value);
         $snsConfig->save();
     }
     return true;
 }
 public function save()
 {
     if (!$this->isValid()) {
         return false;
     }
     $snsConfig = Doctrine::getTable('SnsConfig')->retrieveByName($this->layoutName);
     if (!$snsConfig) {
         $snsConfig = new SnsConfig();
         $snsConfig->setName($this->layoutName);
     }
     $value = $this->choices[$this->values['layout']];
     $snsConfig->setValue($value);
     return (bool) $snsConfig->save();
 }
 public function save()
 {
     foreach ($this->getValues() as $k => $v) {
         if (!isset($this->configs[$k])) {
             continue;
         }
         $config = Doctrine::getTable('SnsConfig')->retrieveByName($this->configs[$k]);
         if (!$config) {
             $config = new SnsConfig();
             $config->setName($this->configs[$k]);
         }
         $config->setValue($v);
         $config->save();
     }
 }
 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();
         }
     }
 }
// run the migrate
//--------------------
$t->info('run migrate of The opIntroFriendPlugin');

// set revision
$snsConfig = Doctrine::getTable('SnsConfig')->createQuery()
->where('name = ?', 'opIntroFriendPlugin_revision')
->fetchOne();
if (!$snsConfig)
{
  $snsConfig = new SnsConfig();
  $snsConfig->setName('opIntroFriendPlugin_revision');
}
$snsConfig->setValue(2);
$snsConfig->save();

// execute
exec('./symfony openpne:migrate --target=opIntroFriendPlugin');

// success tests
//--------------------
$t->info('After running the migration of opIntroFriendPlugin');

$t->is($table->createQuery()->count(), 3, 'count of intro_friend');
$t->isa_ok($table->find(1), 'IntroFriend', 'introductory of friend is exist');
$t->isa_ok($table->find(2), 'IntroFriend', 'introductory of friend is exist');
$t->isa_ok($table->find(3), 'IntroFriend', 'introductory of friend is exist');
$t->isa_ok($table->find(4), 'boolean', 'introductory of non friend was deleted');
$t->isa_ok($table->find(5), 'boolean', 'introductory of non friend was deleted');
$t->isa_ok($table->find(6), 'boolean', 'introductory of non friend was deleted');