Issues (13)

src/Product.php (1 issue)

1
<?php
2
3
namespace codingFive0\octadesk;
4
5
class Product extends Octadesk
6
{
7
8
    public function __construct($accToken)
9
    {
10
        $this->setAccesToken($accToken);
11
        parent::__construct();
12
    }
13
14
    public function findProducts(string $keywords = null, bool $onlyEnabledItems = true, int $page = 1)
15
    {
16
        $this->request(
17
            "GET",
18
            "products/search",
19
            [
20
                "keywords" => $keywords,
21
                "onlyEnabledItems" => $onlyEnabledItems,
22
                "page" => $page,
23
                "asSuggestion" => true
24
            ]
25
        );
26
27
        return $this;
28
    }
29
30
    public function createProduct()
31
    {
32
        $body = [
0 ignored issues
show
The assignment to $body is dead and can be removed.
Loading history...
33
            "id" => "string",
34
            "isEnabled" => true,
35
            "sku" => "string",
36
            "productGroup" => [
37
                "id" => "string",
38
                "name" => "string",
39
                "dateCreation" => "2020-04-30T17:40:26.236Z",
40
                "description" => "string",
41
                "isEnabled" => true,
42
                "fields" => [
43
                    "string"
44
                ],
45
                "products" => [
46
                    null
47
                ]
48
            ],
49
            "members" => [
50
                [
51
                    "code" => "string",
52
                    "name" => "string",
53
                    "value" => []
54
                ]
55
            ],
56
            "publicMembers" => [
57
                [
58
                    "code" => "string",
59
                    "name" => "string",
60
                    "value" => []
61
                ]
62
            ],
63
            "thumbUrl" => "string"
64
        ];
65
    }
66
}