src/models/UserSetting.php
public function set($key, $value)
    {
        $array = &$this->data;
        $keys = explode(self::SEPERATOR, $key);
        $i = 1;
        foreach ($keys as $item) {
            if (is_array($array) && array_key_exists($item, $array) && !is_array($array[$item]) && $i !== count($keys)) {
                return false;
            }
            $array = &$array[$item];
            $i++;
        }
        $array = $value;
        $this->save();
        return true;
    }
public function set($key, $value)
    {
        $array = &$this->data;
        $keys = explode(self::SEPERATOR, $key);
        $i = 1;
        foreach ($keys as $item) {
            if (is_array($array) && array_key_exists($item, $array) && !is_array($array[$item]) && $i !== count($keys)) {
                return false;
            }
            $array = &$array[$item];
            $i++;
        }
        $array = $value;
        $this->save();
        return true;
    }
public function set ( $ key , $ value ) { $ array = & $ this -> data ; $ keys = explode ( self :: SEPERATOR , $ key ) ; $ i = 1 ; foreach ( $ keys as $ item ) { if ( is_array ( $ array ) && array_key_exists ( $ item , $ array ) && ! is_array ( $ array [ $ item ] ) && $ i !== count ( $ keys ) ) { return false ; } $ array = & $ array [ $ item ] ; $ i ++ ; } $ array = $ value ; $ this -> save ( ) ; return true ; }
Add a new element to the user settings array.

@param string $key
@param array|string|boolean $value
@return bool
Add a new element to the user settings array .