1 | <?php |
||
14 | class Boards extends FollowableProvider |
||
15 | { |
||
16 | use CanBeDeleted, Searchable, SendsMessages, ResolvesCurrentUser, BoardInvites; |
||
17 | |||
18 | const BOARD_PRIVACY_PUBLIC = 'public'; |
||
19 | const BOARD_PRIVACY_PRIVATE = 'secret'; |
||
20 | |||
21 | /** |
||
22 | * @var array |
||
23 | */ |
||
24 | protected $loginRequiredFor = [ |
||
25 | 'my', |
||
26 | 'forMe', |
||
27 | 'create', |
||
28 | ]; |
||
29 | |||
30 | protected $searchScope = 'boards'; |
||
31 | protected $entityIdName = 'board_id'; |
||
32 | protected $followersFor = 'board_id'; |
||
33 | |||
34 | protected $followUrl = UrlBuilder::RESOURCE_FOLLOW_BOARD; |
||
35 | protected $unFollowUrl = UrlBuilder::RESOURCE_UNFOLLOW_BOARD; |
||
36 | protected $deleteUrl = UrlBuilder::RESOURCE_DELETE_BOARD; |
||
37 | protected $followersUrl = UrlBuilder::RESOURCE_BOARD_FOLLOWERS; |
||
38 | |||
39 | protected $messageEntityName = 'board'; |
||
40 | |||
41 | /** |
||
42 | * Get boards for user by username. |
||
43 | * |
||
44 | * @param string $username |
||
45 | * |
||
46 | * @return array |
||
47 | */ |
||
48 | public function forUser($username) |
||
59 | |||
60 | /** |
||
61 | * Get boards for current logged in user. |
||
62 | * |
||
63 | * @return array |
||
64 | */ |
||
65 | public function forMe() |
||
73 | |||
74 | /** |
||
75 | * @return array |
||
76 | */ |
||
77 | public function my() |
||
81 | |||
82 | /** |
||
83 | * Get info about user's board. |
||
84 | * |
||
85 | * @param string $username |
||
86 | * @param string $board |
||
87 | * |
||
88 | * @return array|bool |
||
89 | */ |
||
90 | public function info($username, $board) |
||
100 | |||
101 | /** |
||
102 | * @param string $board |
||
103 | * @return string |
||
104 | */ |
||
105 | protected function formatBoardName($board) |
||
112 | |||
113 | /** |
||
114 | * Get pins from board by boardId. |
||
115 | * |
||
116 | * @param int $boardId |
||
117 | * @param int $limit |
||
118 | * |
||
119 | * @return Pagination |
||
120 | */ |
||
121 | public function pins($boardId, $limit = Pagination::DEFAULT_LIMIT) |
||
129 | |||
130 | /** |
||
131 | * Update board info. Gets boardId and an associative array as params. Available keys of the array are: |
||
132 | * 'name', 'category', 'description', 'privacy'. |
||
133 | * |
||
134 | * - 'privacy' can be 'public' or 'secret'. 'public' by default. |
||
135 | * - 'category' is 'other' by default. |
||
136 | * |
||
137 | * @param $boardId |
||
138 | * @param $attributes |
||
139 | * @return mixed |
||
140 | */ |
||
141 | public function update($boardId, $attributes) |
||
156 | |||
157 | /** |
||
158 | * Create a new board. |
||
159 | * |
||
160 | * @param string $name |
||
161 | * @param string $description |
||
162 | * @param string $privacy Can be 'public' or 'secret'. 'public' by default. |
||
163 | * |
||
164 | * @return bool |
||
165 | */ |
||
166 | public function create($name, $description, $privacy = self::BOARD_PRIVACY_PUBLIC) |
||
176 | |||
177 | /** |
||
178 | * Create a new board. |
||
179 | * |
||
180 | * @param string $name |
||
181 | * @param string $description |
||
182 | * |
||
183 | * @return bool |
||
184 | */ |
||
185 | public function createPrivate($name, $description) |
||
189 | |||
190 | /** |
||
191 | * Returns title suggestions for pin. |
||
192 | * |
||
193 | * @param string $pinId |
||
194 | * @return array|bool |
||
195 | */ |
||
196 | public function titleSuggestionsFor($pinId) |
||
200 | } |
||
201 |