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 string getCity() Acesso a city |
22
|
|
|
* @method setCity(string $city) Define city |
23
|
|
|
* @method string getComplement() Acesso a complement |
24
|
|
|
* @method setComplement(string $complement) Define complement |
25
|
|
|
* @method string getNeighborhood() Acesso a neighborhood |
26
|
|
|
* @method setNeighborhood(string $neighborhood) Define neighborhood |
27
|
|
|
* @method string getNumber() Acesso a number |
28
|
|
|
* @method setNumber(string $number) Define number |
29
|
|
|
* @method string getPostalCode() Acesso a postalCode |
30
|
|
|
* @method setPostalCode(string $postalCode) Define postalCode |
31
|
|
|
* @method string getReference() Acesso a reference |
32
|
|
|
* @method setReference(string $reference) Define reference |
33
|
|
|
* @method string getState() Acesso a state |
34
|
|
|
* @method setState(string $state) Define state |
35
|
|
|
* @method string getStreet() Acesso a street |
36
|
|
|
* @method setStreet(string $street) Define street |
37
|
|
|
*/ |
38
|
|
|
class Address extends EntityAbstract implements EntityInterface |
39
|
|
|
{ |
40
|
|
|
/** |
41
|
|
|
* @codeCoverageIgnore |
42
|
|
|
*/ |
43
|
|
|
public function getSchema() |
44
|
|
|
{ |
45
|
|
|
return [ |
46
|
|
|
'city' => 'string', |
47
|
|
|
'complement' => 'string', |
48
|
|
|
'neighborhood' => 'string', |
49
|
|
|
'number' => 'string', |
50
|
|
|
'postalCode' => 'string', |
51
|
|
|
'reference' => 'string', |
52
|
|
|
'state' => 'string', |
53
|
|
|
'street' => 'string', |
54
|
|
|
]; |
55
|
|
|
} |
56
|
|
|
|
57
|
|
|
/** |
58
|
|
|
* Entrega array compatível com Schema Comum. |
59
|
|
|
* |
60
|
|
|
* @see https://github.com/gpupo/common-schema/tree/master/src/Trading |
61
|
|
|
*/ |
62
|
3 |
|
public function toSchema() |
63
|
|
|
{ |
64
|
|
|
return [ |
65
|
3 |
|
'streetAddress' => $this->getStreet(), |
66
|
3 |
|
'addressLocality' => $this->getCity(), |
67
|
3 |
|
'addressRegion' => $this->getState(), |
68
|
3 |
|
'addressCountry' => 'BR', |
69
|
3 |
|
'postalCode' => $this->getPostalCode(), |
70
|
3 |
|
'addressComplement' => $this->getComplement(), |
71
|
3 |
|
'addressNumber' => $this->getNumber(), |
72
|
3 |
|
'addressNeighborhood' => $this->getNeighborhood(), |
73
|
3 |
|
'addressReference' => $this->getReference(), |
74
|
|
|
]; |
75
|
|
|
} |
76
|
|
|
} |
77
|
|
|
|