|
@@ 277-287 (lines=11) @@
|
| 274 |
|
* |
| 275 |
|
* @return Models\Campaigns |
| 276 |
|
*/ |
| 277 |
|
public function getCampaigns() |
| 278 |
|
{ |
| 279 |
|
$resource = 'campaigns.json'; |
| 280 |
|
|
| 281 |
|
$response = $this->sendRequest('GET', $this->getServiceUrl($resource)); |
| 282 |
|
|
| 283 |
|
$decodedResponseBody = $this->getDecodedBody($response->getBody()); |
| 284 |
|
|
| 285 |
|
$getCampaignsResponse = new Models\GetCampaignsResponse($decodedResponseBody); |
| 286 |
|
return $getCampaignsResponse->getCampaigns(); |
| 287 |
|
} |
| 288 |
|
|
| 289 |
|
/** |
| 290 |
|
* Get User Campaigns by Login |
|
@@ 296-306 (lines=11) @@
|
| 293 |
|
* |
| 294 |
|
* @return Models\Campaigns |
| 295 |
|
*/ |
| 296 |
|
public function getCampaignsByLogin($login) |
| 297 |
|
{ |
| 298 |
|
$resource = 'campaigns/by_login/' . $login . '.json'; |
| 299 |
|
|
| 300 |
|
$response = $this->sendRequest('GET', $this->getServiceUrl($resource)); |
| 301 |
|
|
| 302 |
|
$decodedResponseBody = $this->getDecodedBody($response->getBody()); |
| 303 |
|
|
| 304 |
|
$getCampaignsResponse = new Models\GetCampaignsResponse($decodedResponseBody); |
| 305 |
|
return $getCampaignsResponse->getCampaigns(); |
| 306 |
|
} |
| 307 |
|
|
| 308 |
|
|
| 309 |
|
/** |
|
@@ 355-365 (lines=11) @@
|
| 352 |
|
* |
| 353 |
|
* @link http://api.yandex.ru/market/partner/doc/dg/reference/get-campaigns-id-orders-id.xml |
| 354 |
|
*/ |
| 355 |
|
public function getOrder($orderId) |
| 356 |
|
{ |
| 357 |
|
$resource = 'campaigns/' . $this->campaignId . '/orders/' . $orderId . '.json'; |
| 358 |
|
|
| 359 |
|
$response = $this->sendRequest('GET', $this->getServiceUrl($resource)); |
| 360 |
|
|
| 361 |
|
$decodedResponseBody = $this->getDecodedBody($response->getBody()); |
| 362 |
|
|
| 363 |
|
$getOrderResponse = new Models\GetOrderResponse($decodedResponseBody); |
| 364 |
|
return $getOrderResponse->getOrder(); |
| 365 |
|
} |
| 366 |
|
|
| 367 |
|
/** |
| 368 |
|
* Get Region |
|
@@ 374-384 (lines=11) @@
|
| 371 |
|
* |
| 372 |
|
* @link https://tech.yandex.ru/market/partner/doc/dg/reference/get-campaigns-id-region-docpage/ |
| 373 |
|
*/ |
| 374 |
|
public function getRegion() |
| 375 |
|
{ |
| 376 |
|
$resource = 'campaigns/' . $this->campaignId . '/region.json'; |
| 377 |
|
|
| 378 |
|
$response = $this->sendRequest('GET', $this->getServiceUrl($resource)); |
| 379 |
|
|
| 380 |
|
$decodedResponseBody = $this->getDecodedBody($response->getBody()); |
| 381 |
|
|
| 382 |
|
$getRegionResponse = new Models\GetRegionResponse($decodedResponseBody); |
| 383 |
|
return $getRegionResponse->getRegion(); |
| 384 |
|
} |
| 385 |
|
|
| 386 |
|
|
| 387 |
|
/** |