1 | <?php |
||
9 | trait TryIt |
||
10 | { |
||
11 | use HandlesRequest, UploadsImages; |
||
12 | |||
13 | /** |
||
14 | * @return array |
||
15 | */ |
||
16 | protected function requiresLoginForTryIt() |
||
24 | |||
25 | /** |
||
26 | * @param string $pinId |
||
27 | * @param array $additionalData |
||
28 | * @param int $limit |
||
29 | * @return Pagination |
||
30 | */ |
||
31 | abstract protected function getAggregatedActivity($pinId, $additionalData = [], $limit); |
||
32 | |||
33 | /** |
||
34 | * Makes a DidIt activity record. |
||
35 | * |
||
36 | * @param string $pinId |
||
37 | * @param string $comment |
||
38 | * @param null|string $pathToImage |
||
39 | * @return array |
||
40 | */ |
||
41 | public function tryIt($pinId, $comment, $pathToImage = null) |
||
49 | |||
50 | /** |
||
51 | * @param string $pinId |
||
52 | * @param string $tryItRecordId |
||
53 | * @param string $comment |
||
54 | * @param string|null $pathToImage |
||
55 | * @return bool|Response |
||
56 | */ |
||
57 | public function editTryIt($pinId, $tryItRecordId, $comment, $pathToImage = null) |
||
64 | |||
65 | /** |
||
66 | * Get the pinners who have tied this pin |
||
67 | * |
||
68 | * @param string $pinId |
||
69 | * @param int $limit |
||
70 | * @return Pagination |
||
71 | */ |
||
72 | public function tried($pinId, $limit = Pagination::DEFAULT_LIMIT) |
||
81 | |||
82 | /** |
||
83 | * @param string $tryItRecordId |
||
84 | * @return bool|Response |
||
85 | */ |
||
86 | public function deleteTryIt($tryItRecordId) |
||
93 | |||
94 | /** |
||
95 | * @param string $pinId |
||
96 | * @param string $comment |
||
97 | * @param string|null $pathToImage |
||
98 | * @return array |
||
99 | */ |
||
100 | protected function makeRequest($pinId, $comment, $pathToImage = null) |
||
116 | |||
117 | /** |
||
118 | * @param string $pathToImage |
||
119 | * @return string |
||
120 | */ |
||
121 | protected function uploadImage($pathToImage) |
||
129 | } |
||
130 |