Set associated userId

@param $id
@return $this
424449
public function setUserId(int $id)
    {

        // Has the id changed?
        if ($id !== $this->userId) {
            // Invalidate existing user
            if ($this->user !== null && $this->user->getId() !== $id) {
                $this->user = null;
            };

            $this->userId = $id;
        }

        return $this;
    }
467746
public function setUsername($id, $username)
    {
        return $this->put($this->getPath().'/'.rawurlencode($id).'/username', array('value' => $username));
    }
822177
public function setNavigationID($id) {
        if(is_string($id) && !empty(trim($id))){
            $this->menuElements['ul_id'] = $id;
        }
        if((is_string($id) && empty(trim($id))) || $id === false){
            $this->menuElements['ul_id'] = '';
        }
        return $this;
    }
675428
public function addUser($id, $userId)
    {
        $xml = new \SimpleXMLElement('<?xml version="1.0"?><user_id>'.$userId.'</user_id>');

        return $this->post('/groups/'.$id.'/users.xml', $xml->asXML());
    }
1056784
public function setValue($id, $value)
    {
        $setting = parent::__invoke();
        $setting->findOrInitById($id);
        $setting->save(['value' => $value]);

        return $this;
    }
1112388
public function edit($id)
    {
        $this->builder->setMode(Builder::MODE_EDIT);
        $this->builder->setResourceId($id);

        $this->setFieldValue($id);

        return $this;
    }
757895
public function setId($id)
    {
       	if ($id !== null && is_numeric($id)) {
            $id = (int) $id;
        }
        $this->id = $id;

        return $this;
    }
907016
public function removeById($id)
    {
        if (isset($this->ids[$id])) {
            foreach ($this->ids[$id] as $alias) {
                unset($this->aliases[$alias]);
            }
            unset($this->ids[$id]);
        }

        return $this;
    }
1299057
public function setId($id = null)
    {
        $this->id = ($id !== null) ? $id : SecureKey::generate();

        return $this;
    }
345320
public function & SetId ($id) {
		/** @var $this \MvcCore\Ext\Forms\IForm */
		$this->id = $id;
		self::$instances[$id] = & $this;
		return $this;
	}
840406
public function setId($id)
  {
    if ($this->isLocked()) {
      return $this->getObj()->setId($id)->setLocked();
    } else {
      return parent::setId($id);
    }
  }
344678
public function setId($id = '')
    {
        if (is_string($id) && (empty($id) === true || Format::isIdentifier($id, false) === true)) {
            $this->id = $id;
        } else {
            $msg = "The 'id' argument of a body element must be a valid identifier or an empty string";
            throw new InvalidArgumentException($msg);
        }
    }
916899
public function byId($id)
    {
        if ($user = $this->sentinel->getUserRepository()->findById($id)) {
            $this->sentinel->setUser($user);

            return true;
        }

        return false;
    }
205037
public function withMetaId($id)
	{
		foreach (func_get_args() as $arg) {
			$meta_ids = (array) $arg;
			
			foreach ($meta_ids as $meta_id) {
				$this->filters[]['metas'][] = array('id' => $meta_id);
			}
		}
		
		return $this;
	}
428300
public function setIds($ids): self
    {
        if (\is_array($ids)) {
            $this->_params['values'] = $ids;
        } else {
            $this->_params['values'] = [$ids];
        }

        return $this;
    }
108939
public function setId($id)
    {
        $id = $this->buildId($id);

        if ($this->isRelation($id)) {
            $relations = explode('.', $id);

            $lastElement = array_pop($relations);

            if (!$this->keepOriginalID) {
                $id = $lastElement;
            }

            $this->relations = $relations;
        }

        $this->id = $id;

        return $this;
    }
1219355
public static function set_user_id($user_id) {
	if (self::is_active() == false) {
		$exception = bootstrap::get_library('exception');
		throw new $exception('inactive session');
	}
	
	$_SESSION['_session_user_id'] = $user_id;
}