original_string: public function actionGetPaymentMethodInfo($id) {
  
          if (\Yii::$app->request->isAjax) {
              if (!empty($id)) {
  
                  $method = PaymentMethod::findOne($id);
                  $methodTranslation = $method->translation;
  
                  $method = ArrayHelper::toArray($method);
                  $method['translation'] = ArrayHelper::toArray($methodTranslation);
                  $method['image'] = '/images/payment/' .
                      FileHelper::getFullName(
                          \Yii::$app->shop_imagable->get('payment', 'small', $method['image']
                          ));
                  return json_encode([
                      'paymentMethod' => $method,
                  ]);
              }
          }
          throw new NotFoundHttpException();
      }
code: public function actionGetPaymentMethodInfo($id) {
  
          if (\Yii::$app->request->isAjax) {
              if (!empty($id)) {
  
                  $method = PaymentMethod::findOne($id);
                  $methodTranslation = $method->translation;
  
                  $method = ArrayHelper::toArray($method);
                  $method['translation'] = ArrayHelper::toArray($methodTranslation);
                  $method['image'] = '/images/payment/' .
                      FileHelper::getFullName(
                          \Yii::$app->shop_imagable->get('payment', 'small', $method['image']
                          ));
                  return json_encode([
                      'paymentMethod' => $method,
                  ]);
              }
          }
          throw new NotFoundHttpException();
      }
code_tokens: public function actionGetPaymentMethodInfo ( $ id ) { if ( \ Yii :: $ app -> request -> isAjax ) { if ( ! empty ( $ id ) ) { $ method = PaymentMethod :: findOne ( $ id ) ; $ methodTranslation = $ method -> translation ; $ method = ArrayHelper :: toArray ( $ method ) ; $ method [ 'translation' ] = ArrayHelper :: toArray ( $ methodTranslation ) ; $ method [ 'image' ] = '/images/payment/' . FileHelper :: getFullName ( \ Yii :: $ app -> shop_imagable -> get ( 'payment' , 'small' , $ method [ 'image' ] ) ) ; return json_encode ( [ 'paymentMethod' => $ method , ] ) ; } } throw new NotFoundHttpException ( ) ; }
docstring: Returns payment method model if request is Ajax.
  
  @param integer $id
  @return PaymentMethod
  @throws NotFoundHttpException
docstring_tokens: Returns payment method model if request is Ajax .