1 | <?php |
||
5 | class AccessToken extends \League\OAuth2\Client\Token\AccessToken |
||
6 | { |
||
7 | /** |
||
8 | * All Salesforce Organisation IDs start with this Prefix |
||
9 | */ |
||
10 | const ORG_ID_PREFIX = '00D'; |
||
11 | |||
12 | /** |
||
13 | * Instance URL |
||
14 | * |
||
15 | * @var string |
||
16 | */ |
||
17 | private $instanceUrl; |
||
18 | |||
19 | /** |
||
20 | * Time when the token was issued |
||
21 | * |
||
22 | * @var string |
||
23 | */ |
||
24 | private $issuedAt; |
||
25 | 4 | ||
26 | /** |
||
27 | 4 | * Constructs an access token. |
|
28 | * |
||
29 | 4 | * @param array $options An array of options returned by the service provider |
|
30 | 4 | * in the access token request. The `access_token` option is required. |
|
31 | */ |
||
32 | public function __construct(array $options) |
||
39 | 2 | ||
40 | /** |
||
41 | * Returns Salesforce instance URL related to Access Token |
||
42 | * |
||
43 | * @return string |
||
44 | */ |
||
45 | public function getInstanceUrl() |
||
49 | 6 | ||
50 | 6 | /** |
|
51 | 6 | * Returns time when the Access Token was created as UNIX timestamp |
|
52 | * |
||
53 | * @return string |
||
54 | */ |
||
55 | public function getIssuedAt() |
||
59 | |||
60 | /** |
||
61 | * Returns Organisation ID related to Access Token |
||
62 | * |
||
63 | * @return string|null |
||
64 | */ |
||
65 | public function getOrgId() |
||
71 | } |
||
72 |