| @@ 542-555 (lines=14) @@ | ||
| 539 | * @return \stdClass |
|
| 540 | * @throws TwitchException |
|
| 541 | */ |
|
| 542 | public function authUserGet($token) |
|
| 543 | { |
|
| 544 | if ($this->authConfig === false) { |
|
| 545 | $this->authConfigException(); |
|
| 546 | } |
|
| 547 | ||
| 548 | $queryString = $this->helper->buildQueryString(array( |
|
| 549 | 'oauth_token' => $token, |
|
| 550 | 'client_id' => $this->authConfig['client_id'], |
|
| 551 | )); |
|
| 552 | ||
| 553 | $user = new Methods\User($this->request); |
|
| 554 | return $user->getUserAuth($queryString); |
|
| 555 | } |
|
| 556 | ||
| 557 | /** |
|
| 558 | * Get the authenticated channel |
|
| @@ 564-578 (lines=15) @@ | ||
| 561 | * @return \stdClass |
|
| 562 | * @throws TwitchException |
|
| 563 | */ |
|
| 564 | public function authChannelGet($token) |
|
| 565 | { |
|
| 566 | if ($this->authConfig === false) { |
|
| 567 | $this->authConfigException(); |
|
| 568 | } |
|
| 569 | ||
| 570 | $queryString = $this->helper->buildQueryString(array( |
|
| 571 | 'oauth_token' => $token, |
|
| 572 | 'client_id' => $this->authConfig['client_id'], |
|
| 573 | )); |
|
| 574 | ||
| 575 | $channels = new Methods\Channel; |
|
| 576 | ||
| 577 | return $channels->getChannel($queryString); |
|
| 578 | } |
|
| 579 | ||
| 580 | /** |
|
| 581 | * Returns an array of users who are editors of specified channel |
|
| @@ 588-602 (lines=15) @@ | ||
| 585 | * @return \stdClass |
|
| 586 | * @throws TwitchException |
|
| 587 | */ |
|
| 588 | public function authChannelEditors($token, $channel) |
|
| 589 | { |
|
| 590 | if ($this->authConfig === false) { |
|
| 591 | $this->authConfigException(); |
|
| 592 | } |
|
| 593 | ||
| 594 | $queryString = $this->helper->buildQueryString(array( |
|
| 595 | 'oauth_token' => $token, |
|
| 596 | 'client_id' => $this->authConfig['client_id'], |
|
| 597 | )); |
|
| 598 | ||
| 599 | $channels = new Methods\Channel; |
|
| 600 | ||
| 601 | $channels->getEditors($channel, $queryString); |
|
| 602 | } |
|
| 603 | ||
| 604 | /** |
|
| 605 | * Returns an array of subscriptions who are subscribed to specified channel |
|