PHP 클래스 Webiny\Component\TwitterOAuth\TwitterOAuth

상속: use trait Webiny\Component\StdLib\ComponentTrait
파일 보기 프로젝트 열기: Webiny/Framework 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( Webiny\Component\TwitterOAuth\Bridge\TwitterOAuthInterface $instance ) Base constructor.
delete ( string $url, array $params = [] ) : string | array Make a DELETE request to Twitter API.
get ( string $url, array $params = [] ) : string | array GET wrapper for oAuthRequest.
getAccessToken ( ) : Array | boolean Returns the current access token.
getAuthorizeUrl ( string | array $requestToken ) : string Get the authorize url.
getRequestToken ( ) : string Get the request token.
getResponseCode ( ) : integer Get the response code in http format.
getUserDetails ( ) : TwitterOAuthUser Gets the user details for current authenticated user.
post ( string $url, array $params = [] ) : string | array Make a POST request to Twitter API.
requestAccessToken ( string $requestToken, string $requestTokenSecret, string $oauthToken, string $oauthTokenVerifier ) : string Once we have token, we can run the authorization which than give us the option to request the access token.
setAccessToken ( array $accessToken ) : void Sets the access token.

메소드 상세

__construct() 공개 메소드

Use the TwitterOAuthLoader::getInstance to get a TwitterOAuth instance.
public __construct ( Webiny\Component\TwitterOAuth\Bridge\TwitterOAuthInterface $instance )
$instance Webiny\Component\TwitterOAuth\Bridge\TwitterOAuthInterface

delete() 공개 메소드

Make a DELETE request to Twitter API.
public delete ( string $url, array $params = [] ) : string | array
$url string Api url.
$params array Additional parameters.
리턴 string | array Api response (if json) it will be returned as array.

get() 공개 메소드

GET wrapper for oAuthRequest.
public get ( string $url, array $params = [] ) : string | array
$url string Api url.
$params array Additional parameters.
리턴 string | array Api response (if json) it will be returned as array.

getAccessToken() 공개 메소드

Returns the current access token.
public getAccessToken ( ) : Array | boolean
리턴 Array | boolean False is returned if the access token is not set.

getAuthorizeUrl() 공개 메소드

Get the authorize url.
public getAuthorizeUrl ( string | array $requestToken ) : string
$requestToken string | array Request token returned by Twitter OAuth server.
리턴 string

getRequestToken() 공개 메소드

Get the request token.
public getRequestToken ( ) : string
리턴 string Request token.

getResponseCode() 공개 메소드

Example return: 200
public getResponseCode ( ) : integer
리턴 integer Response code.

getUserDetails() 공개 메소드

Gets the user details for current authenticated user.
public getUserDetails ( ) : TwitterOAuthUser
리턴 TwitterOAuthUser

post() 공개 메소드

Make a POST request to Twitter API.
public post ( string $url, array $params = [] ) : string | array
$url string Api url.
$params array Additional parameters.
리턴 string | array Api response (if json) it will be returned as array.

requestAccessToken() 공개 메소드

Once we have token, we can run the authorization which than give us the option to request the access token.
public requestAccessToken ( string $requestToken, string $requestTokenSecret, string $oauthToken, string $oauthTokenVerifier ) : string
$requestToken string Request token returned by getRequestToken method.
$requestTokenSecret string Request token secret returned by getRequestToken method.
$oauthToken string OAuth token returned by Twitter OAuth server.
$oauthTokenVerifier string OAuth token verifier returned by Twitter OAuth server.
리턴 string

setAccessToken() 공개 메소드

Should throw an exception if it's unable to set the access token.
public setAccessToken ( array $accessToken ) : void
$accessToken array Array[oauth_token, oauth_token_secret]
리턴 void