src/ngrest/base/Plugin.php
public function onSave($event)
    {
        if ($this->isAttributeWriteable($event) && $this->onBeforeSave($event)) {
            if ($this->i18n) {
                $event->sender->setAttribute($this->name, $this->i18nFieldEncode($event->sender->getAttribute($this->name)));
            }
        }
    }
public function onSave($event)
    {
        if ($this->isAttributeWriteable($event) && $this->onBeforeSave($event)) {
            if ($this->i18n) {
                $event->sender->setAttribute($this->name, $this->i18nFieldEncode($event->sender->getAttribute($this->name)));
            }
        }
    }
public function onSave ( $ event ) { if ( $ this -> isAttributeWriteable ( $ event ) && $ this -> onBeforeSave ( $ event ) ) { if ( $ this -> i18n ) { $ event -> sender -> setAttribute ( $ this -> name , $ this -> i18nFieldEncode ( $ event -> sender -> getAttribute ( $ this -> name ) ) ) ; } } }
This event will be triggered `onSave` event. If the model property is not writeable the event will not trigger.

If the beforeSave method returns true and i18n is enabled, the value will be json encoded.

@param \yii\base\ModelEvent $event ModelEvent represents the information available in yii\db\ActiveRecord::EVENT_BEFORE_VALIDATE.
@return void
This event will be triggered onSave event . If the model property is not writeable the event will not trigger .