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\Order\Shippings\Customer; |
16
|
|
|
|
17
|
|
|
use Gpupo\CommonSdk\Entity\EntityAbstract; |
18
|
|
|
use Gpupo\CommonSdk\Entity\EntityInterface; |
19
|
|
|
|
20
|
|
|
/** |
21
|
|
|
* @method Gpupo\NetshoesSdk\Entity\Order\Shippings\Customer\Address getAddress() Acesso a address |
22
|
|
|
* @method setAddress(Gpupo\NetshoesSdk\Entity\Order\Shippings\Customer\Address $address) Define address |
23
|
|
|
* @method string getCellPhone() Acesso a cellPhone |
24
|
|
|
* @method setCellPhone(string $cellPhone) Define cellPhone |
25
|
|
|
* @method string getCustomerName() Acesso a customerName |
26
|
|
|
* @method setCustomerName(string $customerName) Define customerName |
27
|
|
|
* @method string getDocument() Acesso a document |
28
|
|
|
* @method setDocument(string $document) Define document |
29
|
|
|
* @method string getLandLine() Acesso a landLine |
30
|
|
|
* @method setLandLine(string $landLine) Define landLine |
31
|
|
|
* @method string getRecipientName() Acesso a recipientName |
32
|
|
|
* @method setRecipientName(string $recipientName) Define recipientName |
33
|
|
|
* @method string getStateInscription() Acesso a stateInscription |
34
|
|
|
* @method setStateInscription(string $stateInscription) Define stateInscription |
35
|
|
|
* @method string getTradeName() Acesso a tradeName |
36
|
|
|
* @method setTradeName(string $tradeName) Define tradeName |
37
|
|
|
*/ |
38
|
|
|
class Customer extends EntityAbstract implements EntityInterface |
39
|
|
|
{ |
40
|
|
|
protected $primaryKey = 'document'; |
41
|
|
|
|
42
|
|
|
/** |
43
|
|
|
* @codeCoverageIgnore |
44
|
|
|
*/ |
45
|
|
|
public function getSchema() |
46
|
|
|
{ |
47
|
|
|
return [ |
48
|
|
|
'address' => 'object', |
49
|
|
|
'cellPhone' => 'string', |
50
|
|
|
'customerName' => 'string', |
51
|
|
|
'document' => 'string', |
52
|
|
|
'landLine' => 'string', |
53
|
|
|
'recipientName' => 'string', |
54
|
|
|
'stateInscription' => 'string', |
55
|
|
|
'tradeName' => 'string', |
56
|
|
|
]; |
57
|
|
|
} |
58
|
|
|
|
59
|
|
|
/** |
60
|
|
|
* Entrega array compatível com Schema Comum. |
61
|
|
|
* |
62
|
|
|
* @see https://github.com/gpupo/common-schema/tree/master/src/Trading |
63
|
|
|
*/ |
64
|
3 |
|
public function toSchema() |
65
|
|
|
{ |
66
|
|
|
return [ |
67
|
3 |
|
'name' => $this->getCustomerName(), |
68
|
3 |
|
'document' => $this->getDocument(), |
69
|
3 |
|
'birthDate' => '', |
70
|
3 |
|
'email' => '', |
71
|
3 |
|
'gender' => '', |
72
|
3 |
|
'telephone' => $this->getLandLine(), |
73
|
3 |
|
'cellphone' => $this->getCellPhone(), |
74
|
|
|
]; |
75
|
|
|
} |
76
|
|
|
} |
77
|
|
|
|