public function setUserId($userId) {
        $this->userId = $userId;
        if ($this->session !== null) {
            $this->session->set('userId', $userId);
        }
    }
public function setUserId($userId) {
        $this->userId = $userId;
        if ($this->session !== null) {
            $this->session->set('userId', $userId);
        }
    }
public function setUserId ( $ userId ) { $ this -> userId = $ userId ; if ( $ this -> session !== null ) { $ this -> session -> set ( 'userId' , $ userId ) ; } }
Set the user id.

@param int $userId
Set the user id .