/** * Sets and persists this setting's value overwriting any existing value. * * @param mixed $value * @throws \Exception If the current user is not allowed to change the value of this setting. */ public function setValue($value) { $this->checkHasEnoughWritePermission(); if ($this->validate && $this->validate instanceof \Closure) { call_user_func($this->validate, $value, $this); } if ($this->transform && $this->transform instanceof \Closure) { $value = call_user_func($this->transform, $value, $this); } elseif (isset($this->type)) { settype($value, $this->type); } return $this->storage->setValue($this, $value); }
/** * Sets and persists this setting's value overwriting any existing value. * * @param mixed $value * @throws \Exception If the current user is not allowed to change the value of this setting. */ public function setValue($value) { $this->validateValue($value); if ($this->transform && $this->transform instanceof \Closure) { $value = call_user_func($this->transform, $value, $this); } elseif (isset($this->type)) { settype($value, $this->type); } return $this->storage->setValue($this, $value); }