original_string: public function actionUpdate($id)
      {
          $model = $this->findModel($id);
          $model->setScenario('update');
          Yii::$app->response->format = Response::FORMAT_JSON;
          if ($model->load(Yii::$app->request->post())) {
              if ($model->validate()) {
                  if ($model->save(false)) {
                      return $this->renderAjax('@vendor/frenzelgmbh/cm-address/views/widgets/views/_index_single_item', ['model' => $model]);
                  } else {
                      Yii::$app->response->setStatusCode(500);
                      return \Yii::t('net_frenzel_address', 'FRONTEND_FLASH_FAIL_UPDATE');
                  }
              } elseif (Yii::$app->request->isAjax) {
                  Yii::$app->response->setStatusCode(400);
                  return ActiveForm::validate($model);
              }
          }
      }
code: public function actionUpdate($id)
      {
          $model = $this->findModel($id);
          $model->setScenario('update');
          Yii::$app->response->format = Response::FORMAT_JSON;
          if ($model->load(Yii::$app->request->post())) {
              if ($model->validate()) {
                  if ($model->save(false)) {
                      return $this->renderAjax('@vendor/frenzelgmbh/cm-address/views/widgets/views/_index_single_item', ['model' => $model]);
                  } else {
                      Yii::$app->response->setStatusCode(500);
                      return \Yii::t('net_frenzel_address', 'FRONTEND_FLASH_FAIL_UPDATE');
                  }
              } elseif (Yii::$app->request->isAjax) {
                  Yii::$app->response->setStatusCode(400);
                  return ActiveForm::validate($model);
              }
          }
      }
code_tokens: public function actionUpdate ( $ id ) { $ model = $ this -> findModel ( $ id ) ; $ model -> setScenario ( 'update' ) ; Yii :: $ app -> response -> format = Response :: FORMAT_JSON ; if ( $ model -> load ( Yii :: $ app -> request -> post ( ) ) ) { if ( $ model -> validate ( ) ) { if ( $ model -> save ( false ) ) { return $ this -> renderAjax ( '@vendor/frenzelgmbh/cm-address/views/widgets/views/_index_single_item' , [ 'model' => $ model ] ) ; } else { Yii :: $ app -> response -> setStatusCode ( 500 ) ; return \ Yii :: t ( 'net_frenzel_address' , 'FRONTEND_FLASH_FAIL_UPDATE' ) ; } } elseif ( Yii :: $ app -> request -> isAjax ) { Yii :: $ app -> response -> setStatusCode ( 400 ) ; return ActiveForm :: validate ( $ model ) ; } } }
docstring: Update Communication.
  
  @param integer $id Communication ID
  @return mixed
docstring_tokens: Update Communication .