Esempio n. 1
0
 public function setMessage($message)
 {
     if ($this->logisticStrategyI18n) {
         $this->logisticStrategyI18n->message = $message;
         $this->logisticStrategyI18n->scenario = 'update';
         $this->logisticStrategyI18n->save();
     } else {
         $i18n = new LogisticStrategyI18n(['scenario' => 'insert']);
         $i18n->logistic_strategy_id = $this->id;
         $i18n->i18n_id = Yii::$app->language;
         $i18n->message = $message;
         $i18n->save();
     }
 }
Esempio n. 2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getLogisticStrategyI18ns()
 {
     return $this->hasMany(LogisticStrategyI18n::className(), ['logistic_strategy_id' => 'logistic_strategy_id']);
 }