Completed
Pull Request — master (#139)
by
unknown
10:24
created

OfferClient::get()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 10
rs 9.4286
cc 1
eloc 6
nc 1
nop 2
1
<?php
2
/**
3
 * Yandex PHP Library
4
 *
5
 * @copyright NIX Solutions Ltd.
6
 * @link https://github.com/nixsolutions/yandex-php-library
7
 */
8
9
/**
10
 * @namespace
11
 */
12
namespace Yandex\Market\Content\Clients;
13
14
use Yandex\Market\Content\ContentClient;
15
use Yandex\Market\Content\Models;
16
17
/**
18
 * Class OfferClient
19
 *
20
 * @category Yandex
21
 * @package MarketContent
22
 *
23
 * @author   Oleg Scherbakov <[email protected]>
24
 * @created  08.01.16 02:10
25
 */
26
class OfferClient extends ContentClient
27
{
28
    /**
29
     * Get offer information
30
     *
31
     * Returns offer of Yandex.Market service according to params.
32
     * @see https://tech.yandex.ru/market/content-data/doc/dg/reference/offer-id-docpage/
33
     *
34
     * @param string $offerId
35
     * @param array $params
36
     *
37
     * @return Models\ResponseOfferGet
38
     */
39
    public function get($offerId, $params = array())
40
    {
41
        $resource = 'offer/' . $offerId . '.json';
42
        $resource .= '?' . $this->buildQueryString($params);
43
        $response = $this->getServiceResponse($resource);
44
45
        $getOfferResponse = new Models\ResponseOfferGet($response);
46
47
        return $getOfferResponse;
48
    }
49
}