1 | <?php |
||
7 | abstract class FollowableProvider extends EntityProvider |
||
8 | { |
||
9 | /** |
||
10 | * @var string |
||
11 | */ |
||
12 | protected $followUrl; |
||
13 | |||
14 | /** |
||
15 | * @var string |
||
16 | */ |
||
17 | protected $unFollowUrl; |
||
18 | |||
19 | /** |
||
20 | * @var string |
||
21 | */ |
||
22 | protected $followersUrl; |
||
23 | |||
24 | /** |
||
25 | * @var string |
||
26 | */ |
||
27 | protected $followersFor; |
||
28 | |||
29 | /** |
||
30 | * Follow entity by its id. |
||
31 | * |
||
32 | * @param $entityId |
||
33 | * |
||
34 | * @return bool |
||
35 | */ |
||
36 | public function follow($entityId) |
||
40 | |||
41 | /** |
||
42 | * UnFollow entity by its id. |
||
43 | * |
||
44 | * @param $entityId |
||
45 | * |
||
46 | * @return bool |
||
47 | */ |
||
48 | public function unFollow($entityId) |
||
52 | |||
53 | /** |
||
54 | * Make api call for follow/unFollow a entity (user/board). |
||
55 | * |
||
56 | * @param int $entityId |
||
57 | * @param string $resourceUrl |
||
58 | * |
||
59 | * @return bool |
||
60 | */ |
||
61 | protected function followCall($entityId, $resourceUrl) |
||
69 | |||
70 | /** |
||
71 | * Is used for *overloading* follow/unfollow methods. When for pinners |
||
72 | * we can pass either user's name or id. |
||
73 | * |
||
74 | * @param mixed $entityId |
||
75 | * @return int|null |
||
76 | */ |
||
77 | protected function resolveEntityId($entityId) |
||
81 | |||
82 | /** |
||
83 | * @param integer $entityId |
||
84 | * @return array |
||
85 | */ |
||
86 | protected function createFollowRequest($entityId) |
||
100 | |||
101 | /** |
||
102 | * Get followers. |
||
103 | * |
||
104 | * @param string $for |
||
105 | * @param int $limit |
||
106 | * |
||
107 | * @return Pagination |
||
108 | */ |
||
109 | public function followers($for, $limit = Pagination::DEFAULT_LIMIT) |
||
115 | |||
116 | /** |
||
117 | * @return string |
||
118 | */ |
||
119 | protected function getFollowUrl() |
||
123 | |||
124 | /** |
||
125 | * @return string |
||
126 | */ |
||
127 | protected function getUnFollowUrl() |
||
131 | |||
132 | /** |
||
133 | * @return string |
||
134 | */ |
||
135 | protected function getFollowersUrl() |
||
139 | |||
140 | /** |
||
141 | * @return string |
||
142 | */ |
||
143 | protected function getFollowersFor() |
||
147 | } |