-
Notifications
You must be signed in to change notification settings - Fork 74
Connection
Andrea Zoellner edited this page Jul 30, 2015
·
2 revisions
- Class name: Connection
- Namespace: Crew\Unsplash
private mixed $provider
- Visibility: private
public mixed $token
- Visibility: public
mixed Crew\Unsplash\Connection::__construct(\Crew\Unsplash\Provider $provider, \League\OAuth2\Client\Token\AccessToken $token)
- Visibility: public
- $provider Crew\Unsplash\Provider
- $token League\OAuth2\Client\Token\AccessToken
string Crew\Unsplash\Connection::getConnectionUrl($scopes)
Retrieve the url that generates the authorization code.
- Visibility: public
- $scopes mixed
\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
- $code string - <p>Authorization code provide by the Unsplash Oauth2 service</p>
mixed Crew\Unsplash\Connection::setToken(\League\OAuth2\Client\Token\AccessToken $token)
Set a new access token to the connection object.
- Visibility: public
- $token League\OAuth2\Client\Token\AccessToken - <p>Access token to add to the connection object</p>
\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
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