original_string: public function setCurrentUser(\Gems_User_User $user)
      {
          if ($user !== self::$currentUser) {
              $this->unsetCurrentUser();
              self::$currentUser = $user;
  
              // Update the escort variable used by loader
              if ($escort = GemsEscort::getInstance()) {
                  $escort->currentUser = $user;
              }
  
              // Double check in case this function was used as original
              // start for setting the user.
              if (! $user->isCurrentUser()) {
                  $user->setAsCurrentUser(true);
              }
          }
  
          return $this;
      }
code: public function setCurrentUser(\Gems_User_User $user)
      {
          if ($user !== self::$currentUser) {
              $this->unsetCurrentUser();
              self::$currentUser = $user;
  
              // Update the escort variable used by loader
              if ($escort = GemsEscort::getInstance()) {
                  $escort->currentUser = $user;
              }
  
              // Double check in case this function was used as original
              // start for setting the user.
              if (! $user->isCurrentUser()) {
                  $user->setAsCurrentUser(true);
              }
          }
  
          return $this;
      }
code_tokens: public function setCurrentUser ( \ Gems_User_User $ user ) { if ( $ user !== self :: $ currentUser ) { $ this -> unsetCurrentUser ( ) ; self :: $ currentUser = $ user ; // Update the escort variable used by loader if ( $ escort = GemsEscort :: getInstance ( ) ) { $ escort -> currentUser = $ user ; } // Double check in case this function was used as original // start for setting the user. if ( ! $ user -> isCurrentUser ( ) ) { $ user -> setAsCurrentUser ( true ) ; } } return $ this ; }
docstring: Sets a new user as the current user.
  
  @param \Gems_User_User $user
  @return \Gems_User_UserLoader (continuation pattern)
docstring_tokens: Sets a new user as the current user .