Skip to content

Commit

Permalink
getUserInfoFromLogin() doimplementace (#15)
Browse files Browse the repository at this point in the history
* Update GetUserInfoFromLogin.php

+method getUserInfo() returning UserInfo object

* getUserInfoFromLogin method
  • Loading branch information
dhqcz authored Apr 18, 2022
1 parent 22f1ab7 commit 5bde62a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
5 changes: 5 additions & 0 deletions src/Connector.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ public function authenticateMessage(Account $account, DTO\Request\AuthenticateMe
{
return $this->send($account, EndpointProvider::OPERATIONS, $input, DTO\Response\AuthenticateMessage::class);
}

public function getUserInfoFromLogin(Account $account): DTO\Response\GetUserInfoFromLogin
{
return $this->send($account, EndpointProvider::ACCESS, (new DTO\Request\GetUserInfoFromLogin()), DTO\Response\GetUserInfoFromLogin::class);
}

/**
* @deprecated
Expand Down
13 changes: 9 additions & 4 deletions src/DTO/Response/GetUserInfoFromLogin.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace TomasKulhanek\CzechDataBox\DTO\Response;

use JMS\Serializer\Annotation as Serializer;
use TomasKulhanek\CzechDataBox\DTO\UserInfo;
use TomasKulhanek\CzechDataBox\DTO\Response\IResponse;
use TomasKulhanek\CzechDataBox\Traits\DataBoxStatus;

Expand All @@ -19,10 +20,14 @@ class GetUserInfoFromLogin extends IResponse
use DataBoxStatus;

/**
* @Serializer\SkipWhenEmpty
* @Serializer\Type("string")
* @Serializer\SerializedName("p:dbUserInfo")
* @Serializer\Type("TomasKulhanek\CzechDataBox\DTO\UserInfo")
* @Serializer\XmlElement(cdata=false)
* @Serializer\SerializedName("p:dbUserInfo")
*/
protected ?string $userInfo = null;
protected UserInfo $userInfo;

public function getUserInfo(): UserInfo
{
return $this->userInfo;
}
}

0 comments on commit 5bde62a

Please sign in to comment.