original_string: protected function getUser($user)
      {
          $userClass = $this->checkUserClass();
          if (is_numeric($user)) {
              $user = $userClass::find()->id($user)->one();
          } elseif (is_string($user) && strlen($user)) {
              $user = $userClass::find()->guid($user)->one();
          }
          if (!$user || $user->getIsNewRecord()) {
              throw new Exception('User Not Registered.');
          }
          return $user;
      }
code: protected function getUser($user)
      {
          $userClass = $this->checkUserClass();
          if (is_numeric($user)) {
              $user = $userClass::find()->id($user)->one();
          } elseif (is_string($user) && strlen($user)) {
              $user = $userClass::find()->guid($user)->one();
          }
          if (!$user || $user->getIsNewRecord()) {
              throw new Exception('User Not Registered.');
          }
          return $user;
      }
code_tokens: protected function getUser ( $ user ) { $ userClass = $ this -> checkUserClass ( ) ; if ( is_numeric ( $ user ) ) { $ user = $ userClass :: find ( ) -> id ( $ user ) -> one ( ) ; } elseif ( is_string ( $ user ) && strlen ( $ user ) ) { $ user = $ userClass :: find ( ) -> guid ( $ user ) -> one ( ) ; } if ( ! $ user || $ user -> getIsNewRecord ( ) ) { throw new Exception ( 'User Not Registered.' ) ; } return $ user ; }
docstring: Get user from database.
  @param User|string|integer $user User ID.
  @return User
  @throws Exception
docstring_tokens: Get user from database .