| @@ 565-578 (lines=14) @@ | ||
| 562 | * @return \stdClass |
|
| 563 | * @throws TwitchException |
|
| 564 | */ |
|
| 565 | public function authUserGet($token) |
|
| 566 | { |
|
| 567 | if ($this->authConfig === false) { |
|
| 568 | $this->authConfigException(); |
|
| 569 | } |
|
| 570 | ||
| 571 | $queryString = $this->helper->buildQueryString(array( |
|
| 572 | 'oauth_token' => $token, |
|
| 573 | 'client_id' => $this->authConfig['client_id'], |
|
| 574 | )); |
|
| 575 | ||
| 576 | $user = new Methods\User($this->request); |
|
| 577 | return $user->getUserAuth($queryString); |
|
| 578 | } |
|
| 579 | ||
| 580 | /** |
|
| 581 | * Get the authenticated channel |
|
| @@ 587-601 (lines=15) @@ | ||
| 584 | * @return \stdClass |
|
| 585 | * @throws TwitchException |
|
| 586 | */ |
|
| 587 | public function authChannelGet($token) |
|
| 588 | { |
|
| 589 | if ($this->authConfig === false) { |
|
| 590 | $this->authConfigException(); |
|
| 591 | } |
|
| 592 | ||
| 593 | $queryString = $this->helper->buildQueryString(array( |
|
| 594 | 'oauth_token' => $token, |
|
| 595 | 'client_id' => $this->authConfig['client_id'], |
|
| 596 | )); |
|
| 597 | ||
| 598 | $channels = new Methods\Channel; |
|
| 599 | ||
| 600 | return $channels->getChannel($queryString); |
|
| 601 | } |
|
| 602 | ||
| 603 | /** |
|
| 604 | * Returns an array of users who are editors of specified channel |
|
| @@ 611-625 (lines=15) @@ | ||
| 608 | * @return \stdClass |
|
| 609 | * @throws TwitchException |
|
| 610 | */ |
|
| 611 | public function authChannelEditors($token, $channel) |
|
| 612 | { |
|
| 613 | if ($this->authConfig === false) { |
|
| 614 | $this->authConfigException(); |
|
| 615 | } |
|
| 616 | ||
| 617 | $queryString = $this->helper->buildQueryString(array( |
|
| 618 | 'oauth_token' => $token, |
|
| 619 | 'client_id' => $this->authConfig['client_id'], |
|
| 620 | )); |
|
| 621 | ||
| 622 | $channels = new Methods\Channel; |
|
| 623 | ||
| 624 | $channels->getEditors($channel, $queryString); |
|
| 625 | } |
|
| 626 | ||
| 627 | /** |
|
| 628 | * Returns an array of subscriptions who are subscribed to specified channel |
|