ProductSelling   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 64
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 64
c 0
b 0
f 0
wmc 5
lcom 1
cbo 1
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A startSellingProductByProductId() 0 5 1
A startSellingProductBySellerCode() 0 5 1
A stopSellingProductByProductId() 0 5 1
A stopSellingProductBySellerCode() 0 5 1
1
<?php
2
3
namespace Onurkacmaz\LaravelN11\Models;
4
5
use Onurkacmaz\LaravelN11\Exceptions\N11Exception;
6
use Onurkacmaz\LaravelN11\Interfaces\ProductSellingInterface;
7
use Onurkacmaz\LaravelN11\Service;
8
use SoapClient;
9
10
class ProductSelling extends Service implements ProductSellingInterface
11
{
12
13
    /**
14
     * @var SoapClient|null
15
     */
16
    private $_client;
17
18
    /**
19
     * Category constructor
20
     * endPoint set edildi.
21
     * @throws N11Exception|\SoapFault
22
     */
23
    public function __construct()
24
    {
25
        parent::__construct();
26
        $this->_client = $this->setEndPoint(self::END_POINT);
27
    }
28
29
    /**
30
     * @param int $productId
31
     * @return mixed
32
     * @description Satışta olmayan bir ürünün N11 ürün ID si kullanılarak satışa başlanması için kullanılır.
33
     */
34
    public function startSellingProductByProductId(int $productId): object
35
    {
36
        $this->_parameters["productId"] = $productId;
37
        return $this->_client->StartSellingProductByProductId($this->_parameters);
38
    }
39
40
    /**
41
     * @param string $productSellerCode
42
     * @return mixed
43
     * @description Satışta olmayan bir ürünün mağaza ürün kodu kullanılarak satışa başlanması için kullanılır.
44
     */
45
    public function startSellingProductBySellerCode(string $productSellerCode): object
46
    {
47
        $this->_parameters["productSellerCode"] = $productSellerCode;
48
        return $this->_client->StartSellingProductBySellerCode($this->_parameters);
49
    }
50
51
    /**
52
     * @param int $productId
53
     * @return mixed
54
     * @description Satışta olan ürünün n11 ürün ID si kullanılarak satışa kapatılması için kullanılır.
55
     */
56
    public function stopSellingProductByProductId(int $productId): object
57
    {
58
        $this->_parameters["productId"] = $productId;
59
        return $this->_client->StopSellingProductByProductId($this->_parameters);
60
    }
61
62
    /**
63
     * @param string $productSellerCode
64
     * @return mixed
65
     * @description Satışta olan ürünün mağaza ürün kodu kullanılarak satışının durdurulması için kullanılır.
66
     */
67
    public function stopSellingProductBySellerCode(string $productSellerCode): object
68
    {
69
        $this->_parameters["productSellerCode"] = $productSellerCode;
70
        return $this->_client->StopSellingProductBySellerCode($this->_parameters);
71
    }
72
73
}
74