| @@ 36-43 (lines=8) @@ | ||
| 33 | * @param array $res |
|
| 34 | * @return null|array |
|
| 35 | */ |
|
| 36 | public static function parseBoardsInfoResponse($res) |
|
| 37 | { |
|
| 38 | if (isset($res['resource_response']['data']['all_boards'])) { |
|
| 39 | return $res['resource_response']['data']['all_boards']; |
|
| 40 | } |
|
| 41 | ||
| 42 | return null; |
|
| 43 | } |
|
| 44 | } |
|
| 45 | ||
| @@ 108-115 (lines=8) @@ | ||
| 105 | * @param $response |
|
| 106 | * @return bool |
|
| 107 | */ |
|
| 108 | public static function parsePinCreateResponse($response) |
|
| 109 | { |
|
| 110 | if (isset($response['resource_response']['data']['id'])) { |
|
| 111 | return $response['resource_response']['data']['id']; |
|
| 112 | } |
|
| 113 | ||
| 114 | return false; |
|
| 115 | } |
|
| 116 | ||
| 117 | /** |
|
| 118 | * Creates Pinterest API request to get Pin info |
|
| @@ 145-152 (lines=8) @@ | ||
| 142 | * @param array $res |
|
| 143 | * @return null|array |
|
| 144 | */ |
|
| 145 | public static function parsePinInfoResponse($res) |
|
| 146 | { |
|
| 147 | if (isset($res['resource_response']['data'])) { |
|
| 148 | return $res['resource_response']['data']; |
|
| 149 | } |
|
| 150 | ||
| 151 | return null; |
|
| 152 | } |
|
| 153 | ||
| 154 | /** |
|
| 155 | * Creates common pin request data by PinId |
|
| @@ 135-141 (lines=7) @@ | ||
| 132 | * @param $response |
|
| 133 | * @return array|null |
|
| 134 | */ |
|
| 135 | protected static function _getDataFromResponse($response) |
|
| 136 | { |
|
| 137 | if (isset($response['resource_response']['data'])) { |
|
| 138 | return $response['resource_response']['data']; |
|
| 139 | } |
|
| 140 | return null; |
|
| 141 | } |
|
| 142 | } |
|
| 143 | ||