/**
  * update
  *
  * @param ConfigEntity $config config object
  *
  * @return ConfigEntity
  */
 protected function update(ConfigEntity $config)
 {
     $diff = $config->getDirty();
     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));
 }