RainLab\Translate\Models\Locale::beforeUpdate PHP Method

beforeUpdate() public method

public beforeUpdate ( )
    public function beforeUpdate()
    {
        if ($this->isDirty('is_default')) {
            $this->makeDefault();
            if (!$this->is_default) {
                throw new ValidationException(['is_default' => Lang::get('rainlab.translate::lang.locale.unset_default', ['locale' => $this->name])]);
            }
        }
    }