public static function getCurrencySymbolArray() { $symbolsArray = []; $symbols = NsiCurrencySymbol::find()->all(); foreach ($symbols as $symbol) { $symbolsArray[$symbol->currency_symbol] = $symbol->currency_symbol; } return $symbolsArray; }
/** * 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()]); } }
/** * @return \yii\db\ActiveQuery */ public function getNsiCurrencySymbols() { return $this->hasMany(NsiCurrencySymbol::className(), ['currency_code' => 'currency_code']); }
/** * @return \yii\db\ActiveQuery */ public function getCurrencyCode0() { return $this->hasOne(NsiCurrencySymbol::className(), ['currency_code' => 'currency_code', 'currency_symbol' => 'currency_symbol']); }