/** * * @param IUser $user */ public function setUser(IUser $user) { if (!$user->isValid()) { throw new ErrorException(t('Unknown username and/or password'), E_ERROR); } $this->getSession()->set(self::SES_USER_KEY, $user); }