Passed
Push — main ( 50f306...ffa6b9 )
by Daniel
11:52
created

PlaybackHistory::setUser()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Uxmp\Core\Orm\Model;
6
7
/**
8
 * Describes the database model which contains the playback history of all users
9
 *
10
 * @Entity(repositoryClass="\Uxmp\Core\Orm\Repository\PlaybackHistoryRepository")
11
 * @Table(name="playback_history")
12
 */
13
class PlaybackHistory implements PlaybackHistoryInterface
14
{
15
    /**
16
     * @Id
17
     * @Column(type="integer")
18
     * @GeneratedValue
19
     */
20
    private int $id;
21
22
    /**
23
     * @Column(type="integer")
24
     */
25
    private int $song_id;
0 ignored issues
show
introduced by
The private property $song_id is not used, and could be removed.
Loading history...
26
27
    /**
28
     * @Column(type="integer")
29
     */
30
    private int $user_id;
0 ignored issues
show
introduced by
The private property $user_id is not used, and could be removed.
Loading history...
31
32
    /**
33
     * @Column(type="datetime")
34
     */
35
    private \DateTimeInterface $play_date;
36
37
    /**
38
     * @ManyToOne(targetEntity="User")
39
     * @JoinColumn(name="user_id", referencedColumnName="id", onDelete="CASCADE")
40
     */
41
    private UserInterface $user;
42
43
    /**
44
     * @ManyToOne(targetEntity="Song")
45
     * @JoinColumn(name="song_id", referencedColumnName="id", onDelete="CASCADE")
46
     */
47
    private SongInterface $song;
48
49
    public function getId(): int
50
    {
51
        return $this->id;
52
    }
53
54 1
    public function getUser(): UserInterface
55
    {
56 1
        return $this->user;
57
    }
58
59 1
    public function setUser(UserInterface $user): PlaybackHistoryInterface
60
    {
61 1
        $this->user = $user;
62 1
        return $this;
63
    }
64
65 1
    public function getSong(): SongInterface
66
    {
67 1
        return $this->song;
68
    }
69
70 1
    public function setSong(SongInterface $song): PlaybackHistoryInterface
71
    {
72 1
        $this->song = $song;
73 1
        return $this;
74
    }
75
76 1
    public function getPlayDate(): \DateTimeInterface
77
    {
78 1
        return $this->play_date;
79
    }
80
81 1
    public function setPlayDate(\DateTimeInterface $play_date): PlaybackHistoryInterface
82
    {
83 1
        $this->play_date = $play_date;
84 1
        return $this;
85
    }
86
}
87