Ticket   A
last analyzed

Complexity

Total Complexity 12

Size/Duplication

Total Lines 140
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 23
c 1
b 0
f 0
dl 0
loc 140
rs 10
wmc 12

12 Methods

Rating   Name   Duplication   Size   Complexity  
A setAttendee() 0 4 1
A setCategory() 0 4 1
A schema() 0 10 1
A __construct() 0 3 1
A setId() 0 4 1
A setPremium() 0 4 1
A setSection() 0 4 1
A getPremium() 0 3 1
A getId() 0 3 1
A getCategory() 0 3 1
A getSection() 0 3 1
A getAttendee() 0 3 1
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
     *  + &emsp; [`'document'`] string (opcional).
27
     *  + &emsp; [`'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
}