GetnetCredentials::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
1
<?php
2
3
namespace Ipag\Sdk\Support\Credentials\PaymentMethods;
4
5
use Ipag\Sdk\Model\Model;
6
use Ipag\Sdk\Model\Schema\Schema;
7
use Ipag\Sdk\Model\Schema\SchemaBuilder;
8
9
/**
10
 * GetnetCredentials Class
11
 *
12
 * Classe responsável pela credencial da identidade `Getnet`.
13
 */
14
final class GetnetCredentials extends Model
15
{
16
    /**
17
     *  @param array $data
18
     *  array de dados da credencial da Getnet.
19
     *
20
     *  + [`'establishment_number'`] string (opcional).
21
     *  + [`'key'`] string (opcional).
22
     *  + [`'user'`] string (opcional).
23
     *  + [`'password'`] string (opcional).
24
     *
25
     */
26
    public function __construct(?array $data = [])
27
    {
28
        parent::__construct($data);
29
    }
30
    public function schema(SchemaBuilder $schema): Schema
31
    {
32
        $schema->string('establishment_number')->nullable();
33
        $schema->string('key')->nullable();
34
        $schema->string('user')->nullable();
35
        $schema->string('password')->nullable();
36
37
        return $schema->build();
38
    }
39
40
    /**
41
     * Retorna o valor da propriedade `establishment_number`.
42
     *
43
     * @return string|null
44
     */
45
    public function getEstablishmentNumber(): ?string
46
    {
47
        return $this->get('establishment_number');
48
    }
49
50
    /**
51
     * Seta o valor da propriedade `establishment_number`.
52
     *
53
     * @param string|null $establishmentNumber
54
     * @return self
55
     */
56
    public function setEstablishmentNumber(?string $establishmentNumber = null): self
57
    {
58
        $this->set('establishment_number', $establishmentNumber);
59
        return $this;
60
    }
61
62
    /**
63
     * Retorna o valor da propriedade `key`.
64
     *
65
     * @return string|null
66
     */
67
    public function getKey(): ?string
68
    {
69
        return $this->get('key');
70
    }
71
72
    /**
73
     * Seta o valor da propriedade `key`.
74
     *
75
     * @param string|null $key
76
     * @return self
77
     */
78
    public function setKey(?string $key = null): self
79
    {
80
        $this->set('key', $key);
81
        return $this;
82
    }
83
84
    /**
85
     * Retorna o valor da propriedade `user`.
86
     *
87
     * @return string|null
88
     */
89
    public function getUser(): ?string
90
    {
91
        return $this->get('user');
92
    }
93
94
    /**
95
     * Seta o valor da propriedade `user`.
96
     *
97
     * @param string|null $user
98
     * @return self
99
     */
100
    public function setUser(?string $user = null): self
101
    {
102
        $this->set('user', $user);
103
        return $this;
104
    }
105
106
    /**
107
     * Retorna o valor da propriedade `password`.
108
     *
109
     * @return string|null
110
     */
111
    public function getPassword(): ?string
112
    {
113
        return $this->get('password');
114
    }
115
116
    /**
117
     * Seta o valor da propriedade `password`.
118
     *
119
     * @param string|null $password
120
     * @return self
121
     */
122
    public function setPassword(?string $password = null): self
123
    {
124
        $this->set('password', $password);
125
        return $this;
126
    }
127
128
}