Ejemplo n.º 1
0
 /**
  * Updates an existing PriceTypes model.
  * If update is successful, the browser will be redirected to the 'view' page.
  * @param integer $id
  * @return mixed
  */
 public function actionUpdate($id)
 {
     $model = $this->findModel($id);
     if ($model->load(Yii::$app->request->post()) && $model->save()) {
         return $this->redirect(['view', 'id' => $model->id]);
     } else {
         return $this->render('update', ['model' => $model, 'currencyCodeArray' => NsiCurrency::getCurrencyCodeArray(), 'currencySymbolArray' => NsiCurrencySymbol::getCurrencySymbolArray(), 'statusArray' => PriceTypes::getStatusArray()]);
     }
 }
Ejemplo n.º 2
0
 public static function getCurrencyCodeArray()
 {
     $codeArray = [];
     $codes = NsiCurrency::find()->all();
     foreach ($codes as $code) {
         $codeArray[$code->currency_code] = $code->currency_name;
     }
     return $codeArray;
 }
Ejemplo n.º 3
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getCurrencyCode()
 {
     return $this->hasOne(NsiCurrency::className(), ['currency_code' => 'currency_code']);
 }