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

makeDefault() public method

Makes this model the default
public makeDefault ( ) : void
return void
    public function makeDefault()
    {
        if (!$this->is_enabled) {
            throw new ValidationException(['is_enabled' => Lang::get('rainlab.translate::lang.locale.disabled_default', ['locale' => $this->name])]);
        }
        $this->newQuery()->where('id', $this->id)->update(['is_default' => true]);
        $this->newQuery()->where('id', '<>', $this->id)->update(['is_default' => false]);
    }