Nette\Security\User::getStorage PHP Method

getStorage() public method

public getStorage ( ) : Nette\Security\IUserStorage
return Nette\Security\IUserStorage
    public function getStorage()
    {
        return $this->storage;
    }

Usage Example

 public function adminLogin($username, $password)
 {
     $row = $this->database->table('loginadmin')->where('name', $username)->fetch();
     if (!$row) {
         throw new Nette\Security\AuthenticationException('Nesprávné přihlašovací jméno.');
     }
     if (!($password == $row['password'])) {
         throw new Nette\Security\AuthenticationException('Nesprávné heslo.');
     }
     $this->user->getStorage()->setNamespace('App\\AdminModule');
     $this->user->login(new Nette\Security\Identity($row['id'], $row['name']));
 }
All Usage Examples Of Nette\Security\User::getStorage