Completed
Push — master ( ac28ba...d1c608 )
by Adriano
05:00
created

Pedido::getReferencia()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Integracao\ControlPay\Model;
4
5
use Integracao\ControlPay\Helpers\SerializerHelper;
6
7
/**
8
 * Class Pedido
9
 * @package Integracao\ControlPay\Model
10
 */
11
class Pedido implements \JsonSerializable
12
{
13
    /**
14
     * @var integer
15
     */
16
    private $id;
17
18
    /**
19
     * @var integer
20
     */
21
    private $pedidoId;
22
23
    /**
24
     * @var string
25
     */
26
    private $referencia;
27
28
    /**
29
     * @var double
30
     */
31
    private $valorTotalPedido;
32
33
    /**
34
     * @var string
35
     */
36
    private $urlRetorno;
37
38
    /**
39
     * @var array
40
     */
41
    private $produtos;
42
43
    /**
44
     * @var string
45
     */
46
    private $data;
47
48
    /**
49
     * @var string
50
     */
51
    private $hora;
52
53
    /**
54
     * @var double
55
     */
56
    private $valor;
57
58
    /**
59
     * @var string
60
     */
61
    private $valorFormat;
62
63
    /**
64
     * @var double
65
     */
66
    private $valorAberto;
67
68
    /**
69
     * @var string
70
     */
71
    private $valorAbertoFormat;
72
73
    /**
74
     * @var double
75
     */
76
    private $valorOriginalPago;
77
78
    /**
79
     * @var string
80
     */
81
    private $valorOriginalPagoFormat;
82
83
    /**
84
     * @var double
85
     */
86
    private $valorOriginalEmPagamento;
87
88
    /**
89
     * @var string
90
     */
91
    private $valorOriginalEmPagamentoFormat;
92
93
    /**
94
     * @var string
95
     */
96
    private $tipo;
97
98
    /**
99
     * @var integer
100
     */
101
    private $quantidade;
102
103
    /**
104
     * @var integer
105
     */
106
    private $quantidadeTransacoes;
107
108
    /**
109
     * @var PedidoStatus
110
     */
111
    private $pedidoStatus;
112
113
    /**
114
     * Pedido constructor.
115
     */
116
    public function __construct()
117
    {
118
    }
119
120
    /**
121
     * @return int
122
     */
123
    public function getPedidoId()
124
    {
125
        return $this->pedidoId;
126
    }
127
128
    /**
129
     * @param int $pedidoId
130
     * @return Pedido
131
     */
132
    public function setPedidoId($pedidoId)
133
    {
134
        $this->pedidoId = $pedidoId;
135
        return $this;
136
    }
137
138
    /**
139
     * @return string
140
     */
141
    public function getReferencia()
142
    {
143
        return $this->referencia;
144
    }
145
146
    /**
147
     * @param string $referencia
148
     * @return Pedido
149
     */
150
    public function setReferencia($referencia)
151
    {
152
        $this->referencia = $referencia;
153
        return $this;
154
    }
155
156
    /**
157
     * @return float
158
     */
159
    public function getValorTotalPedido()
160
    {
161
        return $this->valorTotalPedido;
162
    }
163
164
    /**
165
     * @param float $valorTotalPedido
166
     * @return Pedido
167
     */
168
    public function setValorTotalPedido($valorTotalPedido)
169
    {
170
        $this->valorTotalPedido = $valorTotalPedido;
171
        return $this;
172
    }
173
174
    /**
175
     * @return string
176
     */
177
    public function getUrlRetorno()
178
    {
179
        return $this->urlRetorno;
180
    }
181
182
    /**
183
     * @param string $urlRetorno
184
     * @return Pedido
185
     */
186
    public function setUrlRetorno($urlRetorno)
187
    {
188
        $this->urlRetorno = $urlRetorno;
189
        return $this;
190
    }
191
192
    /**
193
     * @return array
194
     */
195
    public function getProdutos()
196
    {
197
        return $this->produtos;
198
    }
199
200
    /**
201
     * @param $produtos
202
     * @return $this
203
     */
204
    public function setProdutos($produtos)
205
    {
206
        foreach ($produtos as $produto)
207
            $this->produtos[] = SerializerHelper::denormalize($produto, Produto::class);
208
209
        return $this;
210
    }
211
212
    /**
213
     * @return string
214
     */
215
    public function getData()
216
    {
217
        return $this->data;
218
    }
219
220
    /**
221
     * @param string $data
222
     * @return Pedido
223
     */
224
    public function setData($data)
225
    {
226
        $this->data = $data;
227
        return $this;
228
    }
229
230
    /**
231
     * @return string
232
     */
233
    public function getHora()
234
    {
235
        return $this->hora;
236
    }
237
238
    /**
239
     * @param string $hora
240
     * @return Pedido
241
     */
242
    public function setHora($hora)
243
    {
244
        $this->hora = $hora;
245
        return $this;
246
    }
247
248
    /**
249
     * @return float
250
     */
251
    public function getValor()
252
    {
253
        return $this->valor;
254
    }
255
256
    /**
257
     * @param float $valor
258
     * @return Pedido
259
     */
260
    public function setValor($valor)
261
    {
262
        $this->valor = $valor;
263
        return $this;
264
    }
265
266
    /**
267
     * @return string
268
     */
269
    public function getValorFormat()
270
    {
271
        return $this->valorFormat;
272
    }
273
274
    /**
275
     * @param string $valorFormat
276
     * @return Pedido
277
     */
278
    public function setValorFormat($valorFormat)
279
    {
280
        $this->valorFormat = $valorFormat;
281
        return $this;
282
    }
283
284
    /**
285
     * @return float
286
     */
287
    public function getValorAberto()
288
    {
289
        return $this->valorAberto;
290
    }
291
292
    /**
293
     * @param float $valorAberto
294
     * @return Pedido
295
     */
296
    public function setValorAberto($valorAberto)
297
    {
298
        $this->valorAberto = $valorAberto;
299
        return $this;
300
    }
301
302
    /**
303
     * @return string
304
     */
305
    public function getValorAbertoFormat()
306
    {
307
        return $this->valorAbertoFormat;
308
    }
309
310
    /**
311
     * @param string $valorAbertoFormat
312
     * @return Pedido
313
     */
314
    public function setValorAbertoFormat($valorAbertoFormat)
315
    {
316
        $this->valorAbertoFormat = $valorAbertoFormat;
317
        return $this;
318
    }
319
320
    /**
321
     * @return float
322
     */
323
    public function getValorOriginalPago()
324
    {
325
        return $this->valorOriginalPago;
326
    }
327
328
    /**
329
     * @param float $valorOriginalPago
330
     * @return Pedido
331
     */
332
    public function setValorOriginalPago($valorOriginalPago)
333
    {
334
        $this->valorOriginalPago = $valorOriginalPago;
335
        return $this;
336
    }
337
338
    /**
339
     * @return string
340
     */
341
    public function getValorOriginalPagoFormat()
342
    {
343
        return $this->valorOriginalPagoFormat;
344
    }
345
346
    /**
347
     * @param string $valorOriginalPagoFormat
348
     * @return Pedido
349
     */
350
    public function setValorOriginalPagoFormat($valorOriginalPagoFormat)
351
    {
352
        $this->valorOriginalPagoFormat = $valorOriginalPagoFormat;
353
        return $this;
354
    }
355
356
    /**
357
     * @return float
358
     */
359
    public function getValorOriginalEmPagamento()
360
    {
361
        return $this->valorOriginalEmPagamento;
362
    }
363
364
    /**
365
     * @param float $valorOriginalEmPagamento
366
     * @return Pedido
367
     */
368
    public function setValorOriginalEmPagamento($valorOriginalEmPagamento)
369
    {
370
        $this->valorOriginalEmPagamento = $valorOriginalEmPagamento;
371
        return $this;
372
    }
373
374
    /**
375
     * @return string
376
     */
377
    public function getValorOriginalEmPagamentoFormat()
378
    {
379
        return $this->valorOriginalEmPagamentoFormat;
380
    }
381
382
    /**
383
     * @param string $valorOriginalEmPagamentoFormat
384
     * @return Pedido
385
     */
386
    public function setValorOriginalEmPagamentoFormat($valorOriginalEmPagamentoFormat)
387
    {
388
        $this->valorOriginalEmPagamentoFormat = $valorOriginalEmPagamentoFormat;
389
        return $this;
390
    }
391
392
    /**
393
     * @return string
394
     */
395
    public function getTipo()
396
    {
397
        return $this->tipo;
398
    }
399
400
    /**
401
     * @param string $tipo
402
     * @return Pedido
403
     */
404
    public function setTipo($tipo)
405
    {
406
        $this->tipo = $tipo;
407
        return $this;
408
    }
409
410
    /**
411
     * @return int
412
     */
413
    public function getQuantidade()
414
    {
415
        return $this->quantidade;
416
    }
417
418
    /**
419
     * @param int $quantidade
420
     * @return Pedido
421
     */
422
    public function setQuantidade($quantidade)
423
    {
424
        $this->quantidade = $quantidade;
425
        return $this;
426
    }
427
428
    /**
429
     * @return PedidoStatus
430
     */
431
    public function getPedidoStatus()
432
    {
433
        return $this->pedidoStatus;
434
    }
435
436
    /**
437
     * @param PedidoStatus $pedidoStatus
438
     * @return Pedido
439
     */
440
    public function setPedidoStatus($pedidoStatus)
441
    {
442
        $this->pedidoStatus = $pedidoStatus;
443
444
        if(is_array($this->pedidoStatus))
445
            $this->pedidoStatus = SerializerHelper::denormalize($this->pedidoStatus, PedidoStatus::class);
446
447
        return $this;
448
    }
449
450
    /**
451
     * @return int
452
     */
453
    public function getQuantidadeTransacoes()
454
    {
455
        return $this->quantidadeTransacoes;
456
    }
457
458
    /**
459
     * @param int $quantidadeTransacoes
460
     * @return Pedido
461
     */
462
    public function setQuantidadeTransacoes($quantidadeTransacoes)
463
    {
464
        $this->quantidadeTransacoes = $quantidadeTransacoes;
465
        return $this;
466
    }
467
468
    /**
469
     * @return int
470
     */
471
    public function getId()
472
    {
473
        return $this->id;
474
    }
475
476
    /**
477
     * @param int $id
478
     * @return Pedido
479
     */
480
    public function setId($id)
481
    {
482
        $this->id = $id;
483
        return $this;
484
    }
485
486
    /**
487
     * @return array
488
     */
489
    function jsonSerialize()
490
    {
491
        return [
492
            'id' => $this->id,
493
            'pedidoId' => $this->pedidoId,
494
            'referencia' => $this->referencia,
495
            'valorTotalPedido' => $this->valorTotalPedido,
496
            'quantidade' => $this->quantidade,
497
            'quantidadeTransacoes' => $this->quantidadeTransacoes,
498
            'urlRetorno' => $this->urlRetorno,
499
            'produtosPedido' => $this->produtos,
500
            'valor' => $this->valor,
501
            'valorFormat' => $this->valorFormat,
502
            'valorOriginalPago' => $this->valorOriginalPago,
503
            'valorOriginalPagoFormat' => $this->valorOriginalPagoFormat,
504
            'valorOriginalEmPagamento' => $this->valorOriginalEmPagamento,
505
            'valorOriginalEmPagamentoFormat' => $this->valorOriginalEmPagamentoFormat,
506
            'tipo' => $this->tipo,
507
            'pedidoStatus' => $this->pedidoStatus
508
        ];
509
    }
510
511
}