public function setValue($value)
    {
        $this->checkHasEnoughWritePermission();

        $config = $this->configureField();

        $this->validateValue($value);

        if ($config->transform && $config->transform instanceof \Closure) {
            $value = call_user_func($config->transform, $value, $this);
        }

        if (isset($this->type) && !is_null($value)) {
            settype($value, $this->type);
        }

        $this->storage->setValue($this->name, $value);
    }
public function setValue($value)
    {
        $this->checkHasEnoughWritePermission();

        $config = $this->configureField();

        $this->validateValue($value);

        if ($config->transform && $config->transform instanceof \Closure) {
            $value = call_user_func($config->transform, $value, $this);
        }

        if (isset($this->type) && !is_null($value)) {
            settype($value, $this->type);
        }

        $this->storage->setValue($this->name, $value);
    }
public function setValue ( $ value ) { $ this -> checkHasEnoughWritePermission ( ) ; $ config = $ this -> configureField ( ) ; $ this -> validateValue ( $ value ) ; if ( $ config -> transform && $ config -> transform instanceof \ Closure ) { $ value = call_user_func ( $ config -> transform , $ value , $ this ) ; } if ( isset ( $ this -> type ) && ! is_null ( $ value ) ) { settype ( $ value , $ this -> type ) ; } $ this -> storage -> setValue ( $ this -> name , $ value ) ; }
Sets and persists this setting's value overwriting any existing value.

Before a value is actually set it will be made sure the current user is allowed to change the value. The value
will be first validated either via a system built-in validate method or via a set {@link FieldConfig::$validate}
custom method. Afterwards the value will be transformed via a possibly specified {@link FieldConfig::$transform}
method. Before storing the actual value, the value will be converted to the actually specified {@link $type}.

@param mixed $value
@throws \Exception If the current user is not allowed to change the value of this setting.
Sets and persists this setting s value overwriting any existing value .