Lote::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Umbrella\Ya\RetornoBoleto;
4
5
use Easy\Collections\ArrayList;
6
use Easy\Collections\VectorInterface;
7
use Umbrella\Ya\RetornoBoleto\Cnab\CnabDetailInterface;
8
use Umbrella\Ya\RetornoBoleto\Cnab\CnabHeaderInterface;
9
use Umbrella\Ya\RetornoBoleto\Cnab\CnabTrailerInterface;
10
11
/**
12
 * Classe que representa um lote do arquivo de retorno.
13
 */
14
class Lote implements LoteInterface
15
{
16
    /**
17
     * @var CnabHeaderInterface
18
     */
19
    protected $header;
20
21
    /**
22
     * @var VectorInterface
23
     */
24
    protected $details;
25
26
    /**
27
     * @var CnabTrailerInterface
28
     */
29
    protected $trailer;
30
31
    /**
32
     * Inicializa uma instância da classe Lote.
33
     */
34
    public function __construct()
35
    {
36
        $this->details = new ArrayList();
37
    }
38
39
    /**
40
     * Adiciona um detalhe ao lote.
41
     * @param CnabDetailInterface $detail
42
     * @return Lote
43
     */
44
    public function addDetail(CnabDetailInterface $detail)
45
    {
46
        $this->details->add($detail);
47
        return $this;
48
    }
49
50
    /**
51
     * Remove um detalhe do lote.
52
     * @param CnabDetailInterface $detail
53
     * @return Lote
54
     */
55
    public function removeDetail(CnabDetailInterface $detail)
56
    {
57
        $this->details->remove($detail);
58
        return $this;
59
    }
60
61
    /**
62
     * Recupera o header do arquivo.
63
     * @return CnabHeaderInterface
64
     */
65
    public function getHeader()
66
    {
67
        return $this->header;
68
    }
69
70
    /**
71
     * Recupera os detalhes do arquivo.
72
     * @return VectorInterface
73
     */
74
    public function getDetails()
75
    {
76
        return $this->details;
77
    }
78
79
    /**
80
     * Recupera o trailer do arquivo.
81
     * @return CnabTrailerInterface
82
     */
83
    public function getTrailer()
84
    {
85
        return $this->trailer;
86
    }
87
88
    /**
89
     * Define o header do arquivo.
90
     * @param CnabHeaderInterface $header
91
     */
92
    public function setHeader(CnabHeaderInterface $header)
93
    {
94
        $this->header = $header;
95
    }
96
97
    /**
98
     * Define os detalhes do arquivo.
99
     * @param VectorInterface $details
100
     */
101
    public function setDetails(VectorInterface $details)
102
    {
103
        $this->details = $details;
104
    }
105
106
    /**
107
     * Define o trailer do arquivo.
108
     * @param CnabTrailerInterface $trailer
109
     */
110
    public function setTrailer(CnabTrailerInterface $trailer)
111
    {
112
        $this->trailer = $trailer;
113
    }
114
}
115