|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/* |
|
4
|
|
|
* This file is part of gpupo/netshoes-sdk |
|
5
|
|
|
* Created by Gilmar Pupo <[email protected]> |
|
6
|
|
|
* For the information of copyright and license you should read the file |
|
7
|
|
|
* LICENSE which is distributed with this source code. |
|
8
|
|
|
* Para a informação dos direitos autorais e de licença você deve ler o arquivo |
|
9
|
|
|
* LICENSE que é distribuído com este código-fonte. |
|
10
|
|
|
* Para obtener la información de los derechos de autor y la licencia debe leer |
|
11
|
|
|
* el archivo LICENSE que se distribuye con el código fuente. |
|
12
|
|
|
* For more information, see <https://www.gpupo.com/>. |
|
13
|
|
|
*/ |
|
14
|
|
|
|
|
15
|
|
|
namespace Gpupo\NetshoesSdk\Entity\Product; |
|
16
|
|
|
|
|
17
|
|
|
use Gpupo\CommonSdk\Entity\EntityAbstract; |
|
18
|
|
|
use Gpupo\CommonSdk\Entity\EntityInterface; |
|
19
|
|
|
|
|
20
|
|
|
/** |
|
21
|
|
|
* Product Entity. |
|
22
|
|
|
* |
|
23
|
|
|
* @method string getProductId() Acesso a productId |
|
24
|
|
|
* @method setProductId(string $productId) Define productId |
|
25
|
|
|
* @method Gpupo\NetshoesSdk\Entity\Product\Skus getSkus() Acesso a skus |
|
26
|
|
|
* @method setSkus(Gpupo\NetshoesSdk\Entity\Product\Skus $skus) Define skus |
|
27
|
|
|
* @method string getDepartment() Acesso a department |
|
28
|
|
|
* @method setDepartment(string $department) Define department |
|
29
|
|
|
* @method string getProductType() Acesso a productType |
|
30
|
|
|
* @method setProductType(string $productType) Define productType |
|
31
|
|
|
* @method string getBrand() Acesso a brand |
|
32
|
|
|
* @method setBrand(string $brand) Define brand |
|
33
|
|
|
* @method Gpupo\NetshoesSdk\Entity\Product\Attributes\Attributes getAttributes() Acesso a attributes |
|
34
|
|
|
* @method setAttributes(Gpupo\NetshoesSdk\Entity\Product\Attributes\Attributes $attributes) Define attributes |
|
35
|
|
|
*/ |
|
36
|
|
|
final class Product extends EntityAbstract implements EntityInterface |
|
37
|
|
|
{ |
|
38
|
|
|
protected $primaryKey = 'productId'; |
|
39
|
|
|
|
|
40
|
|
|
/** |
|
41
|
|
|
* @codeCoverageIgnore |
|
42
|
|
|
*/ |
|
43
|
|
|
public function getSchema() |
|
44
|
|
|
{ |
|
45
|
|
|
return [ |
|
46
|
|
|
'productId' => 'string', |
|
47
|
|
|
'skus' => 'object', |
|
48
|
|
|
'department' => 'string', |
|
49
|
|
|
'productType' => 'string', |
|
50
|
|
|
'brand' => 'string', |
|
51
|
|
|
'attributes' => 'object', |
|
52
|
|
|
]; |
|
53
|
|
|
} |
|
54
|
|
|
|
|
55
|
2 |
|
public function toPatch(array $diff) |
|
56
|
|
|
{ |
|
57
|
2 |
|
$diff[] = 'productId'; |
|
58
|
|
|
|
|
59
|
2 |
|
return $this->partitionByArrayKey($diff); |
|
60
|
|
|
} |
|
61
|
|
|
} |
|
62
|
|
|
|