AbstractCnab::getSacado()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Umbrella\Ya\RetornoBoleto\Cnab;
4
5
use Easy\Collections\ArrayList;
6
use Easy\Collections\VectorInterface;
7
use Umbrella\Ya\RetornoBoleto\Model\Cedente;
8
use Umbrella\Ya\RetornoBoleto\Model\Empresa;
9
use Umbrella\Ya\RetornoBoleto\Model\Sacado;
10
11
abstract class AbstractCnab implements ComposableInterface
12
{
13
    protected $registro;
14
    protected $lote;
15
16
    /**
17
     * @var Cedente
18
     */
19
    protected $cedente;
20
21
    /**
22
     * @var Sacado
23
     */
24
    protected $sacado;
25
26
    /**
27
     *
28
     * @var VectorInterface
29
     */
30
    protected $cnabs;
31
32
    /**
33
     *
34
     * @var VectorInterface
35
     */
36
    protected $ocorrencias;
37
38
    /**
39
     *
40
     * @var Empresa
41
     */
42
    protected $empresa;
43
44
    public function __construct()
45
    {
46
        $this->cnabs = new ArrayList();
47
        $this->ocorrencias = new ArrayList();
48
    }
49
50
    /**
51
     * @return Sacado
52
     */
53
    public function getSacado()
54
    {
55
        return $this->sacado;
56
    }
57
58
    /**
59
     * @param Sacado $sacado
60
     * @return $this
61
     */
62
    public function setSacado(Sacado $sacado)
63
    {
64
        $this->sacado = $sacado;
65
        return $this;
66
    }
67
68
    /**
69
     * @param string $cnab
70
     * @return $this
71
     */
72
    public function addCnab($cnab)
73
    {
74
        $trim = trim($cnab);
75
        if (!empty($trim)) {
76
            $this->cnabs->add($cnab);
77
        }
78
        return $this;
79
    }
80
81
    public function removeCnab($cnab)
82
    {
83
        $this->cnabs->remove($cnab);
84
        return $this;
85
    }
86
87
    public function getCnabs()
88
    {
89
        return $this->cnabs;
90
    }
91
92
    public function setCnabs(VectorInterface $cnabs)
93
    {
94
        $this->cnabs = $cnabs;
95
        return $this;
96
    }
97
98
    public function getRegistro()
99
    {
100
        return $this->registro;
101
    }
102
103
    public function getLote()
104
    {
105
        return $this->lote;
106
    }
107
108
    public function getCedente()
109
    {
110
        return $this->cedente;
111
    }
112
113
    /**
114
     * @param string $registro
115
     * @return $this
116
     */
117
    public function setRegistro($registro)
118
    {
119
        $this->registro = $registro;
120
        return $this;
121
    }
122
123
    /**
124
     * @param string $lote
125
     * @return $this
126
     */
127
    public function setLote($lote)
128
    {
129
        $this->lote = $lote;
130
        return $this;
131
    }
132
133
    public function setCedente(Cedente $cedente)
134
    {
135
        $this->cedente = $cedente;
136
        return $this;
137
    }
138
139
    public function getOcorrencias()
140
    {
141
        return $this->ocorrencias;
142
    }
143
144
    public function setOcorrencias(VectorInterface $ocorrencias)
145
    {
146
        $this->ocorrencias = $ocorrencias;
147
        return $this;
148
    }
149
150
    public function getEmpresa()
151
    {
152
        return $this->empresa;
153
    }
154
155
    public function setEmpresa(Empresa $empresa)
156
    {
157
        $this->empresa = $empresa;
158
        return $this;
159
    }
160
161
    /**
162
     * @param string $ocorrencia
163
     * @return $this
164
     */
165
    public function addOcorrencia($ocorrencia)
166
    {
167
        $trim = trim($ocorrencia);
168
        if (!empty($trim)) {
169
            $this->ocorrencias->add($ocorrencia);
170
        }
171
        return $this;
172
    }
173
174
    public function removeOcorrencia($ocorrencia)
175
    {
176
        $this->ocorrencias->remove($ocorrencia);
177
        return $this;
178
    }
179
}
180