/**
  * update
  *
  * @param ConfigEntity $config config object
  *
  * @return ConfigEntity
  */
 protected function update(ConfigEntity $config)
 {
     $diff = $config->diff();
     if (count($diff) > 0) {
         $this->conn->table($this->table)->where('siteKey', $config->siteKey)->where('name', $config->name)->update($diff);
     }
     return $this->createModel(array_merge($config->getOriginal(), $diff));
 }
Пример #2
0
 /**
  * update document instance config
  * * division, revision 설정 변경 불가.
  *      - 이 설정에 대한 변경은 core 에서 제공 안함.
  *
  * @param ConfigEntity $config document instance config
  * @return ConfigEntity
  */
 public function put(ConfigEntity $config)
 {
     if ($this->get($config->get('instanceId')) === null) {
         throw new Exceptions\ConfigException();
     }
     $diff = $config->diff();
     if (isset($diff['instanceId']) === null) {
         throw new Exceptions\ConfigException();
     }
     $this->configManager->put(sprintf('%s.%s', self::CONFIG_NAME, $config->get('instanceId')), $config->getPureAll());
     return $config;
 }