|
@@ 57-64 (lines=8) @@
|
| 54 |
|
* @param string $text Comment |
| 55 |
|
* @return array |
| 56 |
|
*/ |
| 57 |
|
public function comment($pinId, $text) |
| 58 |
|
{ |
| 59 |
|
$this->request->checkLoggedIn(); |
| 60 |
|
$post = PinHelper::createCommentRequest($pinId, $text); |
| 61 |
|
$postString = UrlHelper::buildRequestString($post); |
| 62 |
|
$response = $this->request->exec(UrlHelper::RESOURCE_COMMENT_PIN, $postString); |
| 63 |
|
return $this->response->getData($response); |
| 64 |
|
} |
| 65 |
|
|
| 66 |
|
/** |
| 67 |
|
* Writes comment for pin with current id |
|
@@ 73-81 (lines=9) @@
|
| 70 |
|
* @param integer $commentId |
| 71 |
|
* @return bool |
| 72 |
|
*/ |
| 73 |
|
public function deleteComment($pinId, $commentId) |
| 74 |
|
{ |
| 75 |
|
$this->request->checkLoggedIn(); |
| 76 |
|
$post = PinHelper::createCommentDeleteRequest($pinId, $commentId); |
| 77 |
|
$postString = UrlHelper::buildRequestString($post); |
| 78 |
|
$response = $this->request->exec(UrlHelper::RESOURCE_COMMENT_DELETE_PIN, $postString); |
| 79 |
|
|
| 80 |
|
return $this->response->checkErrorInResponse($response); |
| 81 |
|
} |
| 82 |
|
|
| 83 |
|
/** |
| 84 |
|
* Create pin. Returns created pin ID |
|
@@ 126-134 (lines=9) @@
|
| 123 |
|
* @param int $pinId |
| 124 |
|
* @return bool |
| 125 |
|
*/ |
| 126 |
|
public function delete($pinId) |
| 127 |
|
{ |
| 128 |
|
$this->request->checkLoggedIn(); |
| 129 |
|
|
| 130 |
|
$post = PinHelper::createSimplePinRequest($pinId); |
| 131 |
|
$postString = UrlHelper::buildRequestString($post); |
| 132 |
|
$response = $this->request->exec(UrlHelper::RESOURCE_DELETE_PIN, $postString); |
| 133 |
|
return $this->response->checkResponse($response); |
| 134 |
|
} |
| 135 |
|
|
| 136 |
|
/** |
| 137 |
|
* Get information of pin by PinID |
|
@@ 142-149 (lines=8) @@
|
| 139 |
|
* @param $pinId |
| 140 |
|
* @return array|bool |
| 141 |
|
*/ |
| 142 |
|
public function info($pinId) |
| 143 |
|
{ |
| 144 |
|
$get = PinHelper::createInfoRequest($pinId); |
| 145 |
|
$url = UrlHelper::RESOURCE_PIN_INFO.'?'.UrlHelper::buildRequestString($get); |
| 146 |
|
$response = $this->request->exec($url); |
| 147 |
|
|
| 148 |
|
return $this->response->checkResponse($response); |
| 149 |
|
} |
| 150 |
|
|
| 151 |
|
|
| 152 |
|
protected function getScope() |