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

Favorite::setDate()   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
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
c 1
b 0
f 0
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
 * @Entity(repositoryClass="\Uxmp\Core\Orm\Repository\FavoriteRepository")
9
 * @Table(name="favorite")
10
 */
11
class Favorite implements FavoriteInterface
12
{
13
    /**
14
     * @Id
15
     * @Column(type="integer")
16
     * @GeneratedValue
17
     */
18
    private int $id;
0 ignored issues
show
introduced by
The private property $id is not used, and could be removed.
Loading history...
19
20
    /**
21
     * @Column(type="integer")
22
     */
23
    private int $user_id;
0 ignored issues
show
introduced by
The private property $user_id is not used, and could be removed.
Loading history...
24
25
    /**
26
     * @Column(type="integer")
27
     */
28
    private int $item_id;
29
30
    /**
31
     * @Column(type="string")
32
     */
33
    private string $type;
34
35
    /**
36
     * @Column(type="datetime")
37
     */
38
    private \DateTimeInterface $date;
39
40
    /**
41
     * @ManyToOne(targetEntity="User")
42
     * @JoinColumn(name="user_id", referencedColumnName="id", onDelete="CASCADE")
43
     */
44
    private UserInterface $user;
45
46 1
    public function setUser(UserInterface $user): FavoriteInterface
47
    {
48 1
        $this->user = $user;
49 1
        return $this;
50
    }
51
52 1
    public function getUser(): UserInterface
53
    {
54 1
        return $this->user;
55
    }
56
57 1
    public function setItemId(int $itemId): FavoriteInterface
58
    {
59 1
        $this->item_id = $itemId;
60 1
        return $this;
61
    }
62
63 1
    public function getItemId(): int
64
    {
65 1
        return $this->item_id;
66
    }
67
68 1
    public function setType(string $type): FavoriteInterface
69
    {
70 1
        $this->type = $type;
71 1
        return $this;
72
    }
73
74 1
    public function getType(): string
75
    {
76 1
        return $this->type;
77
    }
78
79 1
    public function setDate(\DateTimeInterface $date): FavoriteInterface
80
    {
81 1
        $this->date = $date;
82 1
        return $this;
83
    }
84
85 1
    public function getDate(): \DateTimeInterface
86
    {
87 1
        return $this->date;
88
    }
89
}
90