1 | <?php |
||
15 | class Follow |
||
16 | { |
||
17 | /** @var TwitchRequest */ |
||
18 | protected $request; |
||
19 | |||
20 | const URI_CHANNEL_FOLLOWS = 'channels/%s/follows'; |
||
21 | const URI_USER_FOLLOWS_CHANNEL = 'users/%s/follows/channels'; |
||
22 | const URI_USER_FOLLOW_RELATION = 'users/%s/follows/channels/%s'; |
||
23 | |||
24 | /** |
||
25 | * Follow constructor |
||
26 | * @param TwitchRequest $request |
||
27 | */ |
||
28 | public function __construct(TwitchRequest $request) |
||
32 | |||
33 | /** |
||
34 | * Returns a list of follow objects |
||
35 | * @see https://github.com/justintv/Twitch-API/blob/master/v3_resources/follows.md#get-channelschannelfollows |
||
36 | * @param string $channel |
||
37 | * @param string $queryString |
||
38 | * @return \stdClass |
||
39 | * @throws TwitchSDKException |
||
40 | */ |
||
41 | public function getChannelFollows($channel, $queryString) |
||
45 | |||
46 | /** |
||
47 | * Get a user's list of followed channels |
||
48 | * @see https://github.com/justintv/Twitch-API/blob/master/v3_resources/follows.md#get-usersuserfollowschannels |
||
49 | * @param $user |
||
50 | * @param $queryString |
||
51 | * @return \stdClass |
||
52 | * @throws TwitchSDKException |
||
53 | */ |
||
54 | public function userFollowChannels($user, $queryString) |
||
58 | |||
59 | /** |
||
60 | * Returns 404 Not Found if :user is not following :target. Returns a follow object otherwise |
||
61 | * @see https://github.com/justintv/Twitch-API/blob/master/v3_resources/follows.md#get-usersuserfollowschannelstarget |
||
62 | * @param string $user |
||
63 | * @param string $channel |
||
64 | * @return \stdClass |
||
65 | * @throws TwitchSDKException |
||
66 | */ |
||
67 | public function userIsFollowingChannel($user, $channel) |
||
71 | |||
72 | /** |
||
73 | * Set user to follow given channel |
||
74 | * - requires scope 'user_follows_edit' |
||
75 | * @see https://github.com/justintv/Twitch-API/blob/master/v3_resources/follows.md#put-usersuserfollowschannelstarget |
||
76 | * @param string $user |
||
77 | * @param string $channel |
||
78 | * @param string $queryString |
||
79 | * @return \stdClass |
||
80 | * @throws TwitchSDKException |
||
81 | */ |
||
82 | public function followChannel($user, $channel, $queryString) |
||
86 | |||
87 | /** |
||
88 | * Set user to unfollow given channel |
||
89 | * - requires scope 'user_follows_edit' |
||
90 | * @see https://github.com/justintv/Twitch-API/blob/master/v3_resources/follows.md#delete-usersuserfollowschannelstarget |
||
91 | * @param string $user |
||
92 | * @param string $channel |
||
93 | * @param string $queryString |
||
94 | * @return \stdClass |
||
95 | * @throws TwitchSDKException |
||
96 | */ |
||
97 | public function unfollowChannel($user, $channel, $queryString) |
||
101 | } |
||
102 |