Function setUserdata

@author: 713uk13m <dev@nguyenanhung.com>
@time  : 9/30/18 17:01

@param string $data
@param null   $value

@return mixed|void
499089
public static function setUserdata($data = '', $value = NULL)
    {
        if (is_array($data)) {
            foreach ($data as $key => &$value) {
                $_SESSION[$key] = $value;
            }

            return;
        }

        $_SESSION[$data] = $value;
    }
213387
public function with($data, $value = null)
    {
        if (is_string($data)) {
            $this->data = array_merge($this->data, [$data => $value]);
        } elseif (is_array($data)) {
            $this->data = array_merge($this->data, $data);
        }

        return $this;
    }
107129
public function setUsername($value)
    {
        $this->assertValidString($value, false);

        $this->username = $value;
        if ($this->username !== '') {
            $this->flags |= 64;
        } else {
            $this->flags &= ~64;
        }
    }
528932
private function setData($data) {

		if(false === is_array($data)) {
   			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type array, "%s" given', __METHOD__, gettype($data)), E_USER_ERROR);
   		}

		$this -> data = $data;
	}
551577
public function setValue($value, $data = null)
    {
        // Define Value Property:
        
        $this->value = $value;
        
        // Determine Value Type:
        
        if (is_array($value)) {
            
            // Define from Array:
            
            foreach ($this->fields as $dim => $field) {
                
                if (isset($value[$dim])) {
                    $field->setValue($value[$dim]);
                }
                
            }
            
        } elseif ($value instanceof DBDimensions) {
            
            // Define from Field:
            
            foreach ($this->fields as $dim => $field) {
                $field->setValue($value->{$dim});
            }
            
        }
        
        // Answer Receiver:
        
        return $this;
    }
1328351
public function set(string $name, string $value): void
    {
        $this->dataContainer[RequestDataContainer::VAR_HEADER_RAW][$name] = $value;
    }
140292
public function set($data, $value = null)
    {
        //argument 1 must be an array or string
        Argument::i()->test(1, 'array', 'string');

        if (is_array($data)) {
            $this->data = $data;
            return $this;
        }

        $this->data[$data] = $value;

        return $this;
    }
720834
public function assign($data, $value = null) {
        if (is_array($data)) {
            $this->data = array_merge($this->data, $data);
        } else if ($data) {
            $this->data [ $data ] = $value;
        }

        return $this;
    }
986777
public function setData($value = null)
    {
        if ($value !== null && ! $value instanceof \Protobuf\Stream) {
            $value = \Protobuf\Stream::wrap($value);
        }

        $this->Data = $value;
    }
517435
public function set($name, $value = null)
	{
		is_null($name) or \Arr::set($this->data, $name, $value);

		return $this;
	}
371121
public function setUserSetting(string $identifier, string $value): void
    {
        $this->userSettingService->setUserSetting($identifier, $value);
    }
490560
final protected function setData($value)
    {
        $this->storage->set($this->ns, $value, TimeHelper::YEAR);
    }
609848
public function setData($data)
    {
        if (!is_string($data)) {
            $data = json_encode($data);
        }

        $this->data = $data;
    }
111960
public function def($name, $value)
	{
		if (isset($this->data[$name]))
		{
			return;
		}

		$this->data[$name] = $value;
	}
822933
private function setData($data) {
        $this->indcheck = $data[0];
        $this->data = $data[1];
        $this->calculateChecksum();
    }
547244
protected function setData($key, $value)
    {
        $this->data[$key] = (is_array($value)) ? $value : [$value];
    }
1285529
public function assign($name, $value = null)
    {
        if (is_array($name)) {
            $this->data = array_merge($this->data, $name);
        } else {
            $this->data[$name] = $value;
        }

        return true;
    }