protected function checkSafeMode()
    {
        $safeMode = Config::get('cms.enableSafeMode', null);
        if ($safeMode === null) {
            $safeMode = !Config::get('app.debug', false);
        }

        if ($safeMode && $this->isDirty('code') && strlen(trim($this->code))) {
            throw new ApplicationException(Lang::get('cms::lang.cms_object.safe_mode_enabled'));
        }
    }