public function saveTranslations()
    {
        $res = true;
        foreach ($this->_models as $model) {
            $dirty = $model->getDirtyAttributes();
            if (empty($dirty)) {
                continue;
            }
            /** @var \yii\db\ActiveQuery $relation */
            $relation = $this->owner->getRelation($this->relation);
            $model->{key($relation->link)} = $this->owner->getPrimaryKey();

            //Is translation valid?
            if (!$this->isTranslationActive($model)) {
                $this->deleteTranslation($model);
                continue;
            }

            if (!$model->save()) {
                $res = false;
            }
        }
        return $res;
    }
public function saveTranslations()
    {
        $res = true;
        foreach ($this->_models as $model) {
            $dirty = $model->getDirtyAttributes();
            if (empty($dirty)) {
                continue;
            }
            /** @var \yii\db\ActiveQuery $relation */
            $relation = $this->owner->getRelation($this->relation);
            $model->{key($relation->link)} = $this->owner->getPrimaryKey();

            //Is translation valid?
            if (!$this->isTranslationActive($model)) {
                $this->deleteTranslation($model);
                continue;
            }

            if (!$model->save()) {
                $res = false;
            }
        }
        return $res;
    }
public function saveTranslations ( ) { $ res = true ; foreach ( $ this -> _models as $ model ) { $ dirty = $ model -> getDirtyAttributes ( ) ; if ( empty ( $ dirty ) ) { continue ; } /** @var \yii\db\ActiveQuery $relation */ $ relation = $ this -> owner -> getRelation ( $ this -> relation ) ; $ model -> { key ( $ relation -> link ) } = $ this -> owner -> getPrimaryKey ( ) ; //Is translation valid? if ( ! $ this -> isTranslationActive ( $ model ) ) { $ this -> deleteTranslation ( $ model ) ; continue ; } if ( ! $ model -> save ( ) ) { $ res = false ; } } return $ res ; }
Saves all translations models
@return bool
Saves all translations models