Example #1
0
 /**
  * Performs a login with Speedy webservice.
  * @param string $username The username of the client.
  * @param string $password The password of the client.
  * @return Client
  * @throws SoapFault
  * @throws InvalidUsernameOrPasswordException
  * @throws NoUserPermissionsException
  */
 public function login($username, $password)
 {
     if ($this->user instanceof Client && $this->active()) {
         return $this->user;
     }
     $response = $this->call('login', ['username' => $username, 'password' => $password]);
     $this->user = Client::createFromSoapResponse($response, $username, $password);
     return $this->user;
 }