Passed
Push — main ( a0d988...96ccae )
by Daniel
04:13
created

Song   A

Complexity

Total Complexity 18

Size/Duplication

Total Lines 163
Duplicated Lines 0 %

Test Coverage

Coverage 95.45%

Importance

Changes 0
Metric Value
wmc 18
eloc 39
dl 0
loc 163
ccs 42
cts 44
cp 0.9545
rs 10
c 0
b 0
f 0

18 Methods

Rating   Name   Duplication   Size   Complexity  
A getId() 0 3 1
A setCatalog() 0 4 1
A setArtist() 0 4 1
A setTrackNumber() 0 4 1
A setFilename() 0 4 1
A setMbid() 0 4 1
A getLength() 0 3 1
A getArtist() 0 3 1
A setLength() 0 4 1
A setDisc() 0 4 1
A getMbid() 0 3 1
A getDisc() 0 3 1
A getCatalog() 0 3 1
A getFilename() 0 3 1
A getTitle() 0 3 1
A getTrackNumber() 0 3 1
A setTitle() 0 4 1
A getType() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Uxmp\Core\Orm\Model;
6
7
/**
8
 * @Entity(repositoryClass="\Uxmp\Core\Orm\Repository\SongRepository")
9
 * @Table(name="song")
10
 */
11
class Song implements SongInterface
12
{
13
    /**
14
     * @Id
15
     * @Column(type="integer")
16
     * @GeneratedValue
17
     */
18
    private int $id;
19
20
    /**
21
     * @Column(type="string")
22
     */
23
    private string $title = '';
24
25
    /**
26
     * @Column(type="integer")
27
     */
28
    private int $track_number = 0;
29
30
    /**
31
     * @Column(type="integer")
32
     */
33
    private int $artist_id;
34
35
    /**
36
     * @Column(type="integer")
37
     */
38
    private int $disc_id;
39
40
    /**
41
     * @Column(type="text")
42
     */
43
    private string $filename;
44
45
    /**
46
     * @Column(type="integer")
47
     */
48
    private int $catalog_id;
49
50
    /**
51
     * @Column(type="string", length="32", nullable=true, unique=true)
52
     */
53
    private ?string $mbid = null;
54
55
    /**
56
     * @Column(type="integer", length="5")
57
     */
58
    private int $length = 0;
59
60
    /**
61
     * @ManyToOne(targetEntity="Disc", inversedBy="songs")
62
     * @JoinColumn(name="disc_id", referencedColumnName="id", onDelete="CASCADE")
63
     */
64
    private DiscInterface $disc;
65
66
    /**
67
     * @ManyToOne(targetEntity="Artist")
68
     * @JoinColumn(name="artist_id", referencedColumnName="id")
69
     */
70
    private ArtistInterface $artist;
71
72
    /**
73
     * @ManyToOne(targetEntity="Catalog")
74
     * @JoinColumn(name="catalog_id", referencedColumnName="id", onDelete="CASCADE")
75
     */
76
    private CatalogInterface $catalog;
77
78
    public function getId(): int
79
    {
80
        return $this->id;
81
    }
82
83 1
    public function getTitle(): string
84
    {
85 1
        return $this->title;
86
    }
87
88 1
    public function setTitle(string $title): SongInterface
89
    {
90 1
        $this->title = $title;
91 1
        return $this;
92
    }
93
94 1
    public function getArtist(): ArtistInterface
95
    {
96 1
        return $this->artist;
97
    }
98
99 1
    public function setArtist(ArtistInterface $artist): SongInterface
100
    {
101 1
        $this->artist = $artist;
102 1
        return $this;
103
    }
104
105 1
    public function getTrackNumber(): int
106
    {
107 1
        return $this->track_number;
108
    }
109
110 1
    public function setTrackNumber(int $track_number): SongInterface
111
    {
112 1
        $this->track_number = $track_number;
113 1
        return $this;
114
    }
115
116 1
    public function getFilename(): string
117
    {
118 1
        return $this->filename;
119
    }
120
121 1
    public function setFilename(string $filename): SongInterface
122
    {
123 1
        $this->filename = $filename;
124 1
        return $this;
125
    }
126
127 1
    public function getMbid(): ?string
128
    {
129 1
        return $this->mbid;
130
    }
131
132 1
    public function setMbid(?string $mbid): SongInterface
133
    {
134 1
        $this->mbid = $mbid;
135 1
        return $this;
136
    }
137
138 1
    public function getDisc(): DiscInterface
139
    {
140 1
        return $this->disc;
141
    }
142
143 1
    public function setDisc(DiscInterface $disc): SongInterface
144
    {
145 1
        $this->disc = $disc;
146 1
        return $this;
147
    }
148
149 1
    public function getCatalog(): CatalogInterface
150
    {
151 1
        return $this->catalog;
152
    }
153
154 1
    public function setCatalog(CatalogInterface $catalog): SongInterface
155
    {
156 1
        $this->catalog = $catalog;
157 1
        return $this;
158
    }
159
160 1
    public function getLength(): int
161
    {
162 1
        return $this->length;
163
    }
164
165 1
    public function setLength(int $length): SongInterface
166
    {
167 1
        $this->length = $length;
168 1
        return $this;
169
    }
170
171 1
    public function getType(): string
172
    {
173 1
        return 'song';
174
    }
175
}
176