protected function addSetting($name, $value, $group = null, $flag = ISetting::NORMAL, $cachable = false)
    {
        if (empty($name)) {
            throw new \InvalidArgumentException('A setting must have a valid name.');
        }

        if (null === $group) {
            $group = $this->getDefaultSettingGroupName();
        }

        $setting = new Setting($name, $value, $group, $flag);

        $this->result->addSetting($setting, $cachable);

        return $this;
    }