| 1 | <?php |
||
| 22 | class OAuthDecorator extends RequestDecorator |
||
| 23 | { |
||
| 24 | /** |
||
| 25 | * OAuth access token. |
||
| 26 | * |
||
| 27 | * @var string |
||
| 28 | */ |
||
| 29 | protected $access_token; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * OAuth refresh token. |
||
| 33 | * |
||
| 34 | * @var string |
||
| 35 | */ |
||
| 36 | protected $refresh_token; |
||
| 37 | |||
| 38 | /** |
||
| 39 | * Get access token. |
||
| 40 | * |
||
| 41 | * @return string |
||
| 42 | */ |
||
| 43 | public function getAccessToken() |
||
| 47 | |||
| 48 | /** |
||
| 49 | * Set access token. |
||
| 50 | * |
||
| 51 | * @param string $access_token |
||
| 52 | * |
||
| 53 | * @return self |
||
| 54 | */ |
||
| 55 | public function setAccessToken($access_token) |
||
| 61 | |||
| 62 | /** |
||
| 63 | * Sets Authentication header on decorated request. |
||
| 64 | * |
||
| 65 | * @return self |
||
| 66 | * |
||
| 67 | * @throws RequestException When access_token is not set |
||
| 68 | */ |
||
| 69 | public function addAuthentication() |
||
| 81 | } |
||
| 82 |