Completed
Push — master ( d15f5b...9b96d8 )
by Gilmar
26:33
created

Shipping::toLog()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 8
rs 9.4285
ccs 0
cts 3
cp 0
cc 1
eloc 5
nc 1
nop 0
crap 2
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 <http://www.g1mr.com/>.
13
 */
14
15
namespace Gpupo\NetshoesSdk\Entity\Order\Shippings;
16
17
use Gpupo\CommonSdk\Entity\EntityAbstract;
18
use Gpupo\CommonSdk\Entity\EntityInterface;
19
20
/**
21
 * @method int getShippingCode()    Acesso a shippingCode
22
 * @method setShippingCode(integer $shippingCode)    Define shippingCode
23
 * @method Gpupo\NetshoesSdk\Entity\Order\Shippings\Customer\Customer getCustomer()    Acesso a customer
24
 * @method setCustomer(Gpupo\NetshoesSdk\Entity\Order\Shippings\Customer\Customer $customer)    Define customer
25
 * @method float getFreightAmount()    Acesso a freightAmount
26
 * @method setFreightAmount(float $freightAmount)    Define freightAmount
27
 * @method Gpupo\NetshoesSdk\Entity\Order\Shippings\Invoice getInvoice()    Acesso a invoice
28
 * @method setInvoice(Gpupo\NetshoesSdk\Entity\Order\Shippings\Invoice $invoice)    Define invoice
29
 * @method Gpupo\NetshoesSdk\Entity\Order\Shippings\Items\Items getItems()    Acesso a items
30
 * @method setItems(Gpupo\NetshoesSdk\Entity\Order\Shippings\Items\Items $items)    Define items
31
 * @method Gpupo\NetshoesSdk\Entity\Order\Shippings\Sender getSender()    Acesso a sender
32
 * @method setSender(Gpupo\NetshoesSdk\Entity\Order\Shippings\Sender $sender)    Define sender
33
 * @method string getStatus()    Acesso a status
34
 * @method setStatus(string $status)    Define status
35
 * @method Gpupo\NetshoesSdk\Entity\Order\Shippings\Transport getTransport()    Acesso a transport
36
 * @method setTransport(Gpupo\NetshoesSdk\Entity\Order\Shippings\Transport $transport)    Define transport
37
 * @method string getCountry()    Acesso a country
38
 * @method setCountry(string $country)    Define country
39
 * @method string getCancellationReason()    Acesso a cancellationReason
40
 * @method setCancellationReason(string $cancellationReason)    Define cancellationReason
41
 * @method DevolutionItems getDevolutionItems()    Acesso a devolutionItems
42
 * @method setDevolutionItems(DevolutionItems $devolutionItems)    Define devolutionItems
43
 */
44
class Shipping extends EntityAbstract implements EntityInterface
45
{
46
    protected $primaryKey = 'shippingCode';
47
48
    /**
49
     * @codeCoverageIgnore
50
     */
51
    public function getSchema()
52
    {
53
        return [
54
          'shippingCode'       => 'integer',
55
          'customer'           => 'object',
56
          'freightAmount'      => 'number',
57
          'invoice'            => 'object',
58
          'items'              => 'object',
59
          'sender'             => 'object',
60
          'status'             => 'string',
61
          'transport'          => 'object',
62
          'country'            => 'string',
63
          'cancellationReason' => 'string',
64
          'devolutionItems'    => 'object',
65
        ];
66
    }
67
68 2
    public function toArray()
69
    {
70 2
        $array = parent::toArray();
71 2
        unset($array['sender']);
72
73 2
        return $array;
74
    }
75
76
    public function toLog()
77
    {
78
        return $this->partitionByArrayKey([
79
            'shippingCode',
80
            'status',
81
            'cancellationReason',
82
        ]);
83
    }
84
}
85