Set a setting by name

@param string $name
@param string|\StructureAbstract $value
@return \Core\Model\Settings\Structure
6154
public function setSetting( $name, $value )
    {
        $old = isset( $this->settings[$name] )
            ? $this->settings[$name]
            : null;

        if ( $old instanceof self || $value instanceof self )
        {
            if ( $old instanceof self && $value instanceof self )
            {
                $old->setSettings( $value->settings );
            }
            else if ( $old instanceof self )
            {
                if ( $value instanceof Traversable )
                {
                    $value = ArrayUtils::iteratorToArray( $value );
                }

                $old->setSettings( (array) $value );
            }
            else
            {
                $this->settings[$name] = $value;
            }
        }
        else
        {
            $method = array( $this, 'update' . ucfirst( $name ) );

            if ( is_callable( $method ) &&
                 ( ( isset( $value )    && isset( $this->settings[$name] )
                                        && $value != $this->settings[$name] ) ||
                   ( isset( $value )    && ! isset( $this->settings[$name] ) ) ||
                   ( ! isset( $value )  && isset( $this->settings[$name] ) ) ) )
            {
                $value = $method( $value, $old );
            }

            if ( null === $value )
            {
                unset( $this->settings[$name] );
            }
            else
            {
                $this->settings[$name] = $value;
            }
        }

        return $this;
    }
269500
public function set(string $name, $value): self
    {
        $this->vars[$name] = $value;
        return $this;
    }
129581
public function set($name, $value)
    {
        self::preSet($name, $value);

        $this->_container[$name] = $value;
    }
175406
public final function set_config($name, $value) {
        global $DB;

        $dbparams = array('assignment'=>$this->assignment->get_instance()->id,
                          'subtype'=>$this->get_subtype(),
                          'plugin'=>$this->get_type(),
                          'name'=>$name);
        $current = $DB->get_record('assign_plugin_config', $dbparams, '*', IGNORE_MISSING);

        if ($current) {
            $current->value = $value;
            return $DB->update_record('assign_plugin_config', $current);
        } else {
            $setting = new stdClass();
            $setting->assignment = $this->assignment->get_instance()->id;
            $setting->subtype = $this->get_subtype();
            $setting->plugin = $this->get_type();
            $setting->name = $name;
            $setting->value = $value;

            return $DB->insert_record('assign_plugin_config', $setting) > 0;
        }
    }
893771
public function set(string $name, $value) : Recipe
    {
        $this->variables->$name = $value;
        return $this;
    }
891741
public function setConfig($name, $value)
    {
        $this->validateConfig($name)->config[$name] = $this->filterConfig($name, $value);
        return $this;
    }
895628
public function set($name, $value = null)
    {
        if ($this->has($name) && $this->get($name) !== $value)
        {
            $this->offsetSet($name, $value);

            //Reset the model
            $this->__model->reset(array($name));
        }

        return $this;
    }
531529
public function setAttribute($name, $value)
    {
        if (empty($value)) {
            $this->node->removeAttribute($name);
        } else {
            $this->node->setAttribute($name, $value);
        }

        return $this;
    }
905075
public function set($name, $value)
    {
        $this->instance->unlock();
        $result = $this->instance->set($name, $value);
        $this->instance->lock();

        return $result;
    }
1221367
public function setFieldValue($name, $value)
    {
        foreach ($this->fields as $key => $fields) {
            if (isset($fields[$name])) {
                $this->fields[$key][$name]->setValue($value);
            }
        }
        return $this;
    }
551840
public function setAttribute($name, $value = null)
    {
        $this->getAttributes()->set($name, $value);
        return $this;
    }
1118636
public function set($name, $value = null)
    {
        if ($name === 'value') {
            $value = htmlspecialchars($value);
        }
        parent::set($name, $value);

        return $this;
    }
581218
final public function set(string $name, $value)
    {
        $this->container->setParameter($name, static::processValue($value, true));

        return $this;
    }
797194
public function setMeta($name, $value){

        $meta = $this->meta;

        $meta = array_set($meta, $name, $value);

        $this->meta = json_encode($meta);

        $this->save();

        return $this->meta;
    }
1165235
public function setContext($name, $value = null)
    {
        if (is_array($name)) {
            $this->context = $name + $this->context;
        } else {
            $this->context[$name] = $value;
        }
        return $this;
    }
175946
protected function _set($name, $value)
    {
        $this->_data[$name] = $value;

        // Do not reload / save here:
        // 1: other changes might follow,
        // 2: it might not be used,
        // 3: e.g. database saves may change other data.
        $this->invalidateCache();

        return $this;
    }
679153
public static function setConfigValue($name, $value)
    {
        $section = self::getConfig();
        $section[$name] = $value;
        Config::getInstance()->Tracker = $section;
    }