Elcodi\Store\ConnectBundle\Services\OAuthUserProvider::updateAuthorization PHP Method

updateAuthorization() protected method

Updates an existing authorization with data from the resource owner
protected updateAuthorization ( Authorization $authorization, HWI\Bundle\OAuthBundle\OAuth\Response\UserResponseInterface $response ) : Authorization
$authorization Elcodi\Store\ConnectBundle\Entity\Authorization Authorization
$response HWI\Bundle\OAuthBundle\OAuth\Response\UserResponseInterface Response of the resource owner
return Elcodi\Store\ConnectBundle\Entity\Authorization
    protected function updateAuthorization(Authorization $authorization, UserResponseInterface $response)
    {
        $expirationDate = $this->getExpirationDate($response->getExpiresIn());
        $authorization->setAuthorizationToken($response->getAccessToken())->setExpirationDate($expirationDate);
        return $authorization;
    }