Prepare the settings value for the respective setter.

@param $key
@param $value

@return mixed|object

@throws DocumentManagerException
354513
protected function getSetterValue($key, $value)
    {
        if (empty($value)) {
            return;
        }

        switch ($key) {
            case 'redirectTarget':
                $value = $this->documentManager->find($value);
                break;
            case 'permissions':
                $value = json_decode($value, true);
                break;
            case 'navigationContexts':
                $value = json_decode($value);
                break;
        }

        return $value;
    }
249651
public function set($key, $value = null)
     {
         if (isset($this->_settings->$key)) {
             $this->_settings->$key = $value;
         }

         return $this->_settings->$key;
     }
1279013
public function setParam(string $key, $value): Mapping
    {
        $this->_mapping[$key] = $value;

        return $this;
    }
463654
public function set($key, $value)
    {
        $this->load();

        if ( ! $this->has($key)) {
            $this->dirt[$key] = [
                'type' => 'created',
                'value' => $value,
            ];
        }

        if ($this->has($key) && $this->get($key) != $value) {
            $this->dirt[$key] = [
                'type' => 'updated',
                'value' => $value
            ];
        }

        Arr::set($this->settings, $key, $value);

        return $value;
    }
121855
public function set($key, $value) {
        $key = $this->getAbsoluteConfigKey($key);

        array_set($this->config, $key, $value);

        return $this;
    }
849913
public function set($key, $value = null)
    {
        list($namespace, $group, $item) = $this->parseKey($key);

        $collection = $this->getCollection($group, $namespace);

        // We'll need to go ahead and lazy load each configuration groups even when
        // we're just setting a configuration item so that the set item does not
        // get overwritten if a different item in the group is requested later.
        $this->load($group, $namespace, $collection);

        if ($item === null) {
            $this->items[$collection] = $value;
        } else {
            array_set($this->items[$collection], $item, $value);
        }
    }
767412
public function setConfig($key, $value = null)
	{
		\Arr::set($this->config, $key, $value);

		return $this;
	}
851222
public function set($key, $value = null)
    {
        $this->_email->setViewVars(is_string($key) ? [$key => $value] : $key);

        return $this;
    }
1050406
public function setSetting($key, $value = null)
    {
        $this->getSettingsComponent()->set($this->getSettingsCategory(), $key, $value);
    }
564152
public function set($key, $value)
    {
        if ($config = $this->getConfigFor($key)) {
            if ($type = Arr::get($config, 'type')) {
                @settype($value, $type);
            }
            $this->setting->set($key, $value);
        }
    }
733464
public function settingsSet($key, $value)
    {
        $allSettings = $this->settingsGetAll();
        $allSettings[$key] = $value;
        $this->settingsSetAll($allSettings);
    }
669879
public function set(string $key, $value): KeyValueCollectionInterface
    {
        $this->keyMap[strtolower($key)] = $key;
        if ($value instanceof KeyValueCollectionInterface) {
            $value = $value->all();
        }
        $this->collection[$key] = $value;

        return $this;
    }
1027010
public function prepare($key, $value, $schema = null)
    {
        if ($this->collection) {
            return $this->collection->prepare($key, $value, $schema);
        } else {
            return $value;
        }
    }
734781
public function set(string $key, $value): Definition
    {
        $this->data[$key] = $value;

        return $this;
    }
470713
public function set( $key, $value ) {
		$key = $this->addKeyprefixIfNeeded( $key );
		$this->params[$key] = $value;
		return $this;
	}
213157
public function set($key, $value)
    {
        $keys = explode('.', $key);
        $key_string = '';
        foreach ($keys as $i => $_key) {
            $key_string = $key_string . ((is_numeric($_key) || $_key === '') ? "[{$_key}]" : "['{$_key}']");
        }
        $script = sprintf('$this->_params%s = $value;', $key_string);
        eval($script);
    }
590753
public function set($key, $value) {
        if ($key) {
            $this->_data[$key] = $value;
        } else {
            $this->_data = $value;
        }
        $this->_modified = true;
        return $this;
    }