1 | <?php |
||
4 | class Quotation |
||
5 | { |
||
6 | /** |
||
7 | * Fields to be parsed after the response is returned. |
||
8 | * |
||
9 | * @var array |
||
10 | */ |
||
11 | protected $possibleAttributes = [ |
||
12 | 'transportadora_metaname' => 'name', |
||
13 | 'servico_metaname' => 'service_metaname', |
||
14 | 'servico_nome' => 'service_name', |
||
15 | 'cotacao_preco' => 'quotation_price', |
||
16 | 'cotacao_custo' => 'quotation_costs', |
||
17 | 'cotacao_prazo' => 'deadline', |
||
18 | 'cotacao_codigo' => 'quotation_id', |
||
19 | ]; |
||
20 | |||
21 | /** |
||
22 | * Parsed attributes. |
||
23 | * |
||
24 | * @var array |
||
25 | */ |
||
26 | protected $attributes = []; |
||
27 | |||
28 | /** |
||
29 | * Fill this object with raw attributes given by Response. |
||
30 | * |
||
31 | * @param array $rawAttributes |
||
32 | */ |
||
33 | public function fill(array $rawAttributes = []) |
||
43 | |||
44 | /** |
||
45 | * Return all attributes parsed. |
||
46 | * |
||
47 | * @return array |
||
48 | */ |
||
49 | public function attributes(): array |
||
53 | |||
54 | /** |
||
55 | * Returns the cost. |
||
56 | * |
||
57 | * @return string|null |
||
58 | */ |
||
59 | public function getCosts() |
||
63 | |||
64 | /** |
||
65 | * Returns the deadline in days. |
||
66 | * |
||
67 | * @return string|null |
||
68 | */ |
||
69 | public function getDeadline() |
||
73 | |||
74 | /** |
||
75 | * Magic attribute getter. |
||
76 | * |
||
77 | * @param string $attributeName |
||
78 | * |
||
79 | * @return mixed |
||
80 | */ |
||
81 | public function __get(string $attributeName) |
||
85 | } |
||
86 |