1 | <?php |
||
5 | trait Followable |
||
6 | { |
||
7 | use HandlesRequestAndResponse, HasEntityIdName; |
||
8 | /** |
||
9 | * Follow user by user_id. |
||
10 | * |
||
11 | * @param $entityId |
||
12 | * |
||
13 | * @return bool |
||
14 | */ |
||
15 | public function follow($entityId) |
||
19 | |||
20 | /** |
||
21 | * UnFollow user by user_id. |
||
22 | * |
||
23 | * @param $entityId |
||
24 | * |
||
25 | * @return bool |
||
26 | */ |
||
27 | public function unFollow($entityId) |
||
31 | |||
32 | /** |
||
33 | * Make api call for follow/unFollow a entity (user/board). |
||
34 | * |
||
35 | * @param int $entityId |
||
36 | * @param string $resourceUrl |
||
37 | * |
||
38 | * @return bool |
||
39 | */ |
||
40 | protected function followCall($entityId, $resourceUrl) |
||
46 | |||
47 | /** |
||
48 | * @return string |
||
49 | */ |
||
50 | protected function getFollowUrl() |
||
54 | |||
55 | /** |
||
56 | * @return string |
||
57 | */ |
||
58 | protected function getUnFollowUrl() |
||
62 | } |
||
63 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: