public function set($key, $value)
    {
        $keys = explode('.', $key);

        $data = $this->getAll();

        $resource = &$data;
        foreach ($keys as $key) {
            if (!isset($resource[$key]) || !is_array($resource[$key])) {
                $resource[$key] = [];
            }
            $resource = &$resource[$key];
        }
        $resource = $value;

        $this->setAll($data);

        return $this;
    }
public function set($key, $value)
    {
        $keys = explode('.', $key);

        $data = $this->getAll();

        $resource = &$data;
        foreach ($keys as $key) {
            if (!isset($resource[$key]) || !is_array($resource[$key])) {
                $resource[$key] = [];
            }
            $resource = &$resource[$key];
        }
        $resource = $value;

        $this->setAll($data);

        return $this;
    }
public function set ( $ key , $ value ) { $ keys = explode ( '.' , $ key ) ; $ data = $ this -> getAll ( ) ; $ resource = & $ data ; foreach ( $ keys as $ key ) { if ( ! isset ( $ resource [ $ key ] ) || ! is_array ( $ resource [ $ key ] ) ) { $ resource [ $ key ] = [ ] ; } $ resource = & $ resource [ $ key ] ; } $ resource = $ value ; $ this -> setAll ( $ data ) ; return $ this ; }
Set specific value by key if resource set. It's possible to set using . to separate keys by depth.

$getSet->set("one.two.three", "value") is equal to $resource["one"]["two"]["three"] = $value;

@param string $key
@param mixed  $value

@return $this
Set specific value by key if resource set . It s possible to set using . to separate keys by depth .