original_string: public function login($user)
      {
          if (is_object($user)) {
              if (!$this->model) {
                  throw $this->exception('Auth Model should be set');
              }
              $c = get_class($this->model);
  
              if (!$user instanceof $c) {
                  throw $this->exception('Specified model with incompatible class')
                      ->addMoreInfo('required', $c)
                      ->addMoreInfo('supplied', get_class($user));
              }
  
              $this->model = $user;
              $this->memorizeModel();
  
              return $this;
          }
  
          return $this->loginBy($this->login_field, $user);
      }
code: public function login($user)
      {
          if (is_object($user)) {
              if (!$this->model) {
                  throw $this->exception('Auth Model should be set');
              }
              $c = get_class($this->model);
  
              if (!$user instanceof $c) {
                  throw $this->exception('Specified model with incompatible class')
                      ->addMoreInfo('required', $c)
                      ->addMoreInfo('supplied', get_class($user));
              }
  
              $this->model = $user;
              $this->memorizeModel();
  
              return $this;
          }
  
          return $this->loginBy($this->login_field, $user);
      }
code_tokens: public function login ( $ user ) { if ( is_object ( $ user ) ) { if ( ! $ this -> model ) { throw $ this -> exception ( 'Auth Model should be set' ) ; } $ c = get_class ( $ this -> model ) ; if ( ! $ user instanceof $ c ) { throw $ this -> exception ( 'Specified model with incompatible class' ) -> addMoreInfo ( 'required' , $ c ) -> addMoreInfo ( 'supplied' , get_class ( $ user ) ) ; } $ this -> model = $ user ; $ this -> memorizeModel ( ) ; return $ this ; } return $ this -> loginBy ( $ this -> login_field , $ user ) ; }
docstring: Manually Log in as specified users by using login name.
  
  @param string $user
  
  @return $this
docstring_tokens: Manually Log in as specified users by using login name .