Produto::getPreco()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Integracao\ControlPay\Model;
4
use Integracao\ControlPay\Helpers\SerializerHelper;
5
6
/**
7
 * Class Produto
8
 * @package Integracao\ControlPay\Model
9
 */
10
class Produto implements \JsonSerializable
11
{
12
    /**
13
     * @var integer
14
     */
15
    private $id;
16
17
    /**
18
     * @var string
19
     */
20
    private $nome;
21
22
    /**
23
     * @var string
24
     */
25
    private $descricao;
26
27
    /**
28
     * @var integer
29
     */
30
    private $quantidade;
31
32
    /**
33
     * @var float
34
     */
35
    private $valor;
36
37
    /**
38
     * @var float
39
     */
40
    private $preco;
41
42
    /**
43
     * @var string
44
     */
45
    private $fotoThumbnail;
46
47
    /**
48
     * @var string
49
     */
50
    private $ean;
51
52
    /**
53
     * @var ProdutoStatus
54
     */
55
    private $produtoStatus;
56
57
    /**
58
     * Produto constructor.
59
     */
60
    public function __construct()
61
    {
62
    }
63
64
    /**
65
     * @return int
66
     */
67
    public function getId()
68
    {
69
        return $this->id;
70
    }
71
72
    /**
73
     * @param int $id
74
     * @return Produto
75
     */
76
    public function setId($id)
77
    {
78
        $this->id = $id;
79
        return $this;
80
    }
81
82
    /**
83
     * @return string
84
     */
85
    public function getNome()
86
    {
87
        return $this->nome;
88
    }
89
90
    /**
91
     * @param string $nome
92
     * @return Produto
93
     */
94
    public function setNome($nome)
95
    {
96
        $this->nome = $nome;
97
        return $this;
98
    }
99
100
    /**
101
     * @return string
102
     */
103
    public function getDescricao()
104
    {
105
        return $this->descricao;
106
    }
107
108
    /**
109
     * @param string $descricao
110
     * @return Produto
111
     */
112
    public function setDescricao($descricao)
113
    {
114
        $this->descricao = $descricao;
115
        return $this;
116
    }
117
118
    /**
119
     * @return float
120
     */
121
    public function getValor()
122
    {
123
        return $this->valor;
124
    }
125
126
    /**
127
     * @param float $valor
128
     * @return Produto
129
     */
130
    public function setValor($valor)
131
    {
132
        $this->valor = $valor;
133
        return $this;
134
    }
135
136
    /**
137
     * @return int
138
     */
139
    public function getQuantidade()
140
    {
141
        return $this->quantidade;
142
    }
143
144
    /**
145
     * @param int $quantidade
146
     * @return Produto
147
     */
148
    public function setQuantidade($quantidade)
149
    {
150
        $this->quantidade = $quantidade;
151
        return $this;
152
    }
153
154
    /**
155
     * @return float
156
     */
157
    public function getPreco()
158
    {
159
        return $this->preco;
160
    }
161
162
    /**
163
     * @param float $preco
164
     * @return Produto
165
     */
166
    public function setPreco($preco)
167
    {
168
        $this->preco = $preco;
169
        return $this;
170
    }
171
172
    /**
173
     * @return string
174
     */
175
    public function getFotoThumbnail()
176
    {
177
        return $this->fotoThumbnail;
178
    }
179
180
    /**
181
     * @param string $fotoThumbnail
182
     * @return Produto
183
     */
184
    public function setFotoThumbnail($fotoThumbnail)
185
    {
186
        $this->fotoThumbnail = $fotoThumbnail;
187
        return $this;
188
    }
189
190
    /**
191
     * @return string
192
     */
193
    public function getEan()
194
    {
195
        return $this->ean;
196
    }
197
198
    /**
199
     * @param string $ean
200
     * @return Produto
201
     */
202
    public function setEan($ean)
203
    {
204
        $this->ean = $ean;
205
        return $this;
206
    }
207
208
    /**
209
     * @return ProdutoStatus
210
     */
211
    public function getProdutoStatus()
212
    {
213
        return $this->produtoStatus;
214
    }
215
216
    /**
217
     * @param ProdutoStatus $produtoStatus
218
     * @return Produto
219
     */
220
    public function setProdutoStatus($produtoStatus)
221
    {
222
        $this->produtoStatus = $produtoStatus;
223
224
        if(is_array($this->produtoStatus))
225
            $this->produtoStatus = SerializerHelper::denormalize($this->produtoStatus, ProdutoStatus::class);
226
227
        return $this;
228
    }
229
230
    function jsonSerialize()
231
    {
232
        return [
233
            "Id" => $this->id,
234
            "Nome" => $this->nome,
235
            "Descricao" => $this->descricao,
236
            "Valor" => $this->valor,
237
            "Quantidade" => $this->quantidade,
238
            "preco" => $this->preco,
239
            "ean" => $this->ean,
240
            "produtoStatus" => $this->produtoStatus,
241
            "fotoThumbnail" => $this->fotoThumbnail,
242
        ];
243
    }
244
245
246
}