@@ 107-121 (lines=15) @@ | ||
104 | * @param int $boardId |
|
105 | * @return array|bool |
|
106 | */ |
|
107 | public function delete($boardId) |
|
108 | { |
|
109 | $this->request->checkLoggedIn(); |
|
110 | $post = Request::createRequestData( |
|
111 | [ |
|
112 | 'options' => [ |
|
113 | 'board_id' => $boardId |
|
114 | ] |
|
115 | ] |
|
116 | ); |
|
117 | $postString = UrlHelper::buildRequestString($post); |
|
118 | $response = $this->request->exec(UrlHelper::RESOURCE_DELETE_BOARD, $postString); |
|
119 | ||
120 | return $this->response->checkResponse($response); |
|
121 | } |
|
122 | ||
123 | /** |
|
124 | * Create a new board |
@@ 59-66 (lines=8) @@ | ||
56 | * @param string $text Comment |
|
57 | * @return array |
|
58 | */ |
|
59 | public function comment($pinId, $text) |
|
60 | { |
|
61 | $this->request->checkLoggedIn(); |
|
62 | $post = PinHelper::createCommentRequest($pinId, ["text" => $text]); |
|
63 | $postString = UrlHelper::buildRequestString($post); |
|
64 | $response = $this->request->exec(UrlHelper::RESOURCE_COMMENT_PIN, $postString); |
|
65 | return $this->response->getData($response); |
|
66 | } |
|
67 | ||
68 | /** |
|
69 | * Writes comment for pin with current id |
|
@@ 75-83 (lines=9) @@ | ||
72 | * @param integer $commentId |
|
73 | * @return bool |
|
74 | */ |
|
75 | public function deleteComment($pinId, $commentId) |
|
76 | { |
|
77 | $this->request->checkLoggedIn(); |
|
78 | $post = PinHelper::createCommentRequest($pinId, ["comment_id" => $commentId]); |
|
79 | $postString = UrlHelper::buildRequestString($post); |
|
80 | $response = $this->request->exec(UrlHelper::RESOURCE_COMMENT_DELETE_PIN, $postString); |
|
81 | ||
82 | return $this->response->checkErrorInResponse($response); |
|
83 | } |
|
84 | ||
85 | /** |
|
86 | * Create pin. Returns created pin ID |