Skip to content
Andrea Zoellner edited this page Jul 30, 2015 · 2 revisions

Crew\Unsplash\Connection

  • Class name: Connection
  • Namespace: Crew\Unsplash

Properties

$provider

private mixed $provider
  • Visibility: private

$token

public mixed $token
  • Visibility: public

Methods

__construct

mixed Crew\Unsplash\Connection::__construct(\Crew\Unsplash\Provider $provider, \League\OAuth2\Client\Token\AccessToken $token)
  • Visibility: public

Arguments

getConnectionUrl

string Crew\Unsplash\Connection::getConnectionUrl($scopes)

Retrieve the url that generates the authorization code.

  • Visibility: public

Arguments

  • $scopes mixed

generateToken

\Crew\Unsplash\League\OAuth2\Client\Token\AccessToken Crew\Unsplash\Connection::generateToken(string $code)

Generate a new access token object from an authorization code.

  • Visibility: public

Arguments

  • $code string - <p>Authorization code provide by the Unsplash Oauth2 service</p>

setToken

mixed Crew\Unsplash\Connection::setToken(\League\OAuth2\Client\Token\AccessToken $token)

Set a new access token to the connection object.

  • Visibility: public

Arguments

  • $token League\OAuth2\Client\Token\AccessToken - <p>Access token to add to the connection object</p>

refreshToken

\Crew\Unsplash\League\OAuth2\Client\Token\AccessToken Crew\Unsplash\Connection::refreshToken()

Refresh an expired token from the refresh token.

Generate a new AccessToken object from the stdClass provided by the getAccessToken method.

  • Visibility: public

getAuthorizationToken

String Crew\Unsplash\Connection::getAuthorizationToken()

Generate the authorization string pass in the header. Validate if a token is linked to the connection object.

Use the client id if it's not the case. The method also refreshes the access token if it's expired.

  • Visibility: public

Api Index

Clone this wiki locally