Completed
Push — id3-metadata-objects ( a3a88a...ecc500 )
by Daniel
03:22
created

Frame::setName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 5
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
/**
3
 * This file is part of the Metadata package.
4
 *
5
 * @author Daniel Schröder <[email protected]>
6
 */
7
8
namespace GravityMedia\Metadata\ID3v2;
9
10
use GravityMedia\Metadata\ID3v2\FrameInterface;
11
12
/**
13
 * ID3v2 frame
14
 *
15
 * @package GravityMedia\Metadata
16
 */
17
class Frame implements FrameInterface
18
{
19
    /**
20
     * @var string
21
     */
22
    protected $name;
23
24
    /**
25
     * @var int
26
     */
27
    protected $size;
28
29
    /**
30
     * @var array
31
     */
32
    protected $flags;
33
34
    /**
35
     * @var int
36
     */
37
    protected $dataLength;
38
39
    /**
40
     * @var string
41
     */
42
    protected $data;
43
44
    /**
45
     * {@inheritdoc}
46
     */
47
    public function getName()
48
    {
49
        return $this->name;
50
    }
51
52
    /**
53
     * Set name
54
     *
55
     * @param string $name
56
     *
57
     * @return $this
58
     */
59
    public function setName($name)
60
    {
61
        $this->name = $name;
62
        return $this;
63
    }
64
65
    /**
66
     * {@inheritdoc}
67
     */
68
    public function getSize()
69
    {
70
        return $this->size;
71
    }
72
73
    /**
74
     * Set size in bytes
75
     *
76
     * @param int $size
77
     *
78
     * @return $this
79
     */
80
    public function setSize($size)
81
    {
82
        $this->size = $size;
83
        return $this;
84
    }
85
86
    /**
87
     * {@inheritdoc}
88
     */
89
    public function isFlagEnabled($flag)
90
    {
91
        if (isset($this->flags[$flag])) {
92
            return $this->flags[$flag];
93
        }
94
95
        return false;
96
    }
97
98
    /**
99
     * Set flags
100
     *
101
     * @param array $flags
102
     *
103
     * @return $this
104
     */
105
    public function setFlags(array $flags)
106
    {
107
        $this->flags = $flags;
108
        return $this;
109
    }
110
111
    /**
112
     * {@inheritdoc}
113
     */
114
    public function getDataLength()
115
    {
116
        return $this->dataLength;
117
    }
118
119
    /**
120
     * Set data length
121
     *
122
     * @param int $dataLength
123
     *
124
     * @return $this
125
     */
126
    public function setDataLength($dataLength)
127
    {
128
        $this->dataLength = $dataLength;
129
        return $this;
130
    }
131
132
    /**
133
     * {@inheritdoc}
134
     */
135
    public function getData()
136
    {
137
        return $this->data;
138
    }
139
140
    /**
141
     * Set $data
142
     *
143
     * @param string $data
144
     *
145
     * @return $this
146
     */
147
    public function setData($data)
148
    {
149
        $this->data = $data;
150
        return $this;
151
    }
152
}
153