original_string: public function setAsCurrentUser($signalLoader = true, $resetSessionId = true)
      {
          // Get the current variables
          $oldStore = $this->_getVariableStore();
  
          // When $oldStore is a \Zend_Session_Namespace, then this user is already the current user.
          if (! $this->isCurrentUser()) {
              $this->userLoader->unsetCurrentUser();
  
              if ($resetSessionId) {
                  \Zend_Session::regenerateId();
              }
  
              $this->_vars = $this->session;
  
              foreach ($oldStore as $name => $value) {
                  $this->_vars->__set($name, $value);
              }
  
              // Perform the interface switch
              $this->switchLocale();
  
              if ($signalLoader) {
                  $this->userLoader->setCurrentUser($this);
              }
          }
  
          $this->getCurrentOrganization()->setAsCurrentOrganization();
  
          return $this;
      }
code: public function setAsCurrentUser($signalLoader = true, $resetSessionId = true)
      {
          // Get the current variables
          $oldStore = $this->_getVariableStore();
  
          // When $oldStore is a \Zend_Session_Namespace, then this user is already the current user.
          if (! $this->isCurrentUser()) {
              $this->userLoader->unsetCurrentUser();
  
              if ($resetSessionId) {
                  \Zend_Session::regenerateId();
              }
  
              $this->_vars = $this->session;
  
              foreach ($oldStore as $name => $value) {
                  $this->_vars->__set($name, $value);
              }
  
              // Perform the interface switch
              $this->switchLocale();
  
              if ($signalLoader) {
                  $this->userLoader->setCurrentUser($this);
              }
          }
  
          $this->getCurrentOrganization()->setAsCurrentOrganization();
  
          return $this;
      }
code_tokens: public function setAsCurrentUser ( $ signalLoader = true , $ resetSessionId = true ) { // Get the current variables $ oldStore = $ this -> _getVariableStore ( ) ; // When $oldStore is a \Zend_Session_Namespace, then this user is already the current user. if ( ! $ this -> isCurrentUser ( ) ) { $ this -> userLoader -> unsetCurrentUser ( ) ; if ( $ resetSessionId ) { \ Zend_Session :: regenerateId ( ) ; } $ this -> _vars = $ this -> session ; foreach ( $ oldStore as $ name => $ value ) { $ this -> _vars -> __set ( $ name , $ value ) ; } // Perform the interface switch $ this -> switchLocale ( ) ; if ( $ signalLoader ) { $ this -> userLoader -> setCurrentUser ( $ this ) ; } } $ this -> getCurrentOrganization ( ) -> setAsCurrentOrganization ( ) ; return $ this ; }
docstring: Set this user as the current user.
  
  This means that the data about this user will be stored in a session.
  
  @param boolean $signalLoader Do not set, except from UserLoader
  @param boolean $resetSessionId Should the session be reset?
  @return \Gems_User_User (continuation pattern)
docstring_tokens: Set this user as the current user .