1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Ipag\Sdk\Model; |
4
|
|
|
|
5
|
|
|
use Ipag\Sdk\Model\Schema\Schema; |
6
|
|
|
use Ipag\Sdk\Model\Schema\SchemaBuilder; |
7
|
|
|
|
8
|
|
|
/** |
9
|
|
|
* Ticket Class |
10
|
|
|
* |
11
|
|
|
* Classe responsável por representar o recurso Ticket. |
12
|
|
|
* |
13
|
|
|
*/ |
14
|
|
|
final class Ticket extends Model |
15
|
|
|
{ |
16
|
|
|
/** |
17
|
|
|
* @param array $data |
18
|
|
|
* array de dados do Ticket. |
19
|
|
|
* |
20
|
|
|
* + [`'id'`] string (opcional). |
21
|
|
|
* + [`'category'`] string (opcional). |
22
|
|
|
* + [`'premium'`] bool (opcional). |
23
|
|
|
* + [`'section'`] string (opcional). |
24
|
|
|
* |
25
|
|
|
* + [`'attendee'`] array (opcional) dos dados do Attendee. |
26
|
|
|
* +   [`'document'`] string (opcional). |
27
|
|
|
* +   [`'dob'`] string (opcional) {Formato: `Y-m-d`}. |
28
|
|
|
*/ |
29
|
|
|
public function __construct(?array $data = []) |
30
|
|
|
{ |
31
|
|
|
parent::__construct($data); |
32
|
|
|
} |
33
|
|
|
|
34
|
|
|
public function schema(SchemaBuilder $schema): Schema |
35
|
|
|
{ |
36
|
|
|
$schema->string('id')->nullable(); |
37
|
|
|
$schema->string('category')->nullable(); |
38
|
|
|
$schema->bool('premium')->nullable(); |
39
|
|
|
$schema->string('section')->nullable(); |
40
|
|
|
|
41
|
|
|
$schema->has('attendee', Attendee::class)->nullable(); |
42
|
|
|
|
43
|
|
|
return $schema->build(); |
44
|
|
|
} |
45
|
|
|
|
46
|
|
|
/** |
47
|
|
|
* Retorna o valor da propriedade `id`. |
48
|
|
|
* |
49
|
|
|
* @return string|null |
50
|
|
|
*/ |
51
|
|
|
public function getId(): ?string |
52
|
|
|
{ |
53
|
|
|
return $this->get('id'); |
54
|
|
|
} |
55
|
|
|
|
56
|
|
|
/** |
57
|
|
|
* Seta o valor da propriedade `id`. |
58
|
|
|
* |
59
|
|
|
* @param string|null $id |
60
|
|
|
* @return self |
61
|
|
|
*/ |
62
|
|
|
public function setId(?string $id = null): self |
63
|
|
|
{ |
64
|
|
|
$this->set('id', $id); |
65
|
|
|
return $this; |
66
|
|
|
} |
67
|
|
|
|
68
|
|
|
/** |
69
|
|
|
* Retorna o valor da propriedade `category`. |
70
|
|
|
* |
71
|
|
|
* @return string|null |
72
|
|
|
*/ |
73
|
|
|
public function getCategory(): ?string |
74
|
|
|
{ |
75
|
|
|
return $this->get('category'); |
76
|
|
|
} |
77
|
|
|
|
78
|
|
|
/** |
79
|
|
|
* Seta o valor da propriedade `category`. |
80
|
|
|
* |
81
|
|
|
* @param string|null $category |
82
|
|
|
* @return self |
83
|
|
|
*/ |
84
|
|
|
public function setCategory(?string $category = null): self |
85
|
|
|
{ |
86
|
|
|
$this->set('category', $category); |
87
|
|
|
return $this; |
88
|
|
|
} |
89
|
|
|
|
90
|
|
|
/** |
91
|
|
|
* Retorna o valor da propriedade `premium`. |
92
|
|
|
* |
93
|
|
|
* @return boolean|null |
94
|
|
|
*/ |
95
|
|
|
public function getPremium(): ?bool |
96
|
|
|
{ |
97
|
|
|
return $this->get('premium'); |
98
|
|
|
} |
99
|
|
|
|
100
|
|
|
/** |
101
|
|
|
* Seta o valor da propriedade `premium`. |
102
|
|
|
* |
103
|
|
|
* @param boolean|null $premium |
104
|
|
|
* @return self |
105
|
|
|
*/ |
106
|
|
|
public function setPremium(?bool $premium = null): self |
107
|
|
|
{ |
108
|
|
|
$this->set('premium', $premium); |
109
|
|
|
return $this; |
110
|
|
|
} |
111
|
|
|
|
112
|
|
|
/** |
113
|
|
|
* Retorna o valor da propriedade `section`. |
114
|
|
|
* |
115
|
|
|
* @return string|null |
116
|
|
|
*/ |
117
|
|
|
public function getSection(): ?string |
118
|
|
|
{ |
119
|
|
|
return $this->get('section'); |
120
|
|
|
} |
121
|
|
|
|
122
|
|
|
/** |
123
|
|
|
* Seta o valor da propriedade `section`. |
124
|
|
|
* |
125
|
|
|
* @param string|null $section |
126
|
|
|
* @return self |
127
|
|
|
*/ |
128
|
|
|
public function setSection(?string $section = null): self |
129
|
|
|
{ |
130
|
|
|
$this->set('section', $section); |
131
|
|
|
return $this; |
132
|
|
|
} |
133
|
|
|
|
134
|
|
|
/** |
135
|
|
|
* Retorna o valor da propriedade `attendee`. |
136
|
|
|
* |
137
|
|
|
* @return Attendee|null |
138
|
|
|
*/ |
139
|
|
|
public function getAttendee(): ?Attendee |
140
|
|
|
{ |
141
|
|
|
return $this->get('attendee'); |
142
|
|
|
} |
143
|
|
|
|
144
|
|
|
/** |
145
|
|
|
* Seta o valor da propriedade `attendee`. |
146
|
|
|
* |
147
|
|
|
* @param Attendee|null $attendee |
148
|
|
|
* @return self |
149
|
|
|
*/ |
150
|
|
|
public function setAttendee(?Attendee $attendee = null): self |
151
|
|
|
{ |
152
|
|
|
$this->set('attendee', $attendee); |
153
|
|
|
return $this; |
154
|
|
|
} |
155
|
|
|
|
156
|
|
|
} |