|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
|
|
4
|
|
|
namespace IrishDan\NotificationBundle\Test\Entity; |
|
5
|
|
|
|
|
6
|
|
|
use Doctrine\ORM\Mapping as ORM; |
|
7
|
|
|
use IrishDan\NotificationBundle\Notification\DatabaseNotificationInterface; |
|
8
|
|
|
use IrishDan\NotificationBundle\Notification\NotifiableInterface; |
|
9
|
|
|
|
|
10
|
|
|
class Notification implements DatabaseNotificationInterface |
|
11
|
|
|
{ |
|
12
|
|
|
private $id; |
|
13
|
|
|
private $uuid; |
|
14
|
|
|
private $notifiable; |
|
15
|
|
|
private $type; |
|
16
|
|
|
private $title; |
|
17
|
|
|
private $body; |
|
18
|
|
|
private $readAt; |
|
19
|
|
|
private $created; |
|
20
|
|
|
private $updated; |
|
21
|
|
|
|
|
22
|
|
|
public function getId() |
|
23
|
|
|
{ |
|
24
|
|
|
return $this->id; |
|
25
|
|
|
} |
|
26
|
|
|
|
|
27
|
|
|
public function getUuid() |
|
28
|
|
|
{ |
|
29
|
|
|
return $this->uuid; |
|
30
|
|
|
} |
|
31
|
|
|
|
|
32
|
|
|
public function setUuid($uuid) |
|
33
|
|
|
{ |
|
34
|
|
|
$this->uuid = $uuid; |
|
35
|
|
|
} |
|
36
|
|
|
|
|
37
|
|
|
public function getNotifiable() |
|
38
|
|
|
{ |
|
39
|
|
|
return $this->notifiable; |
|
40
|
|
|
} |
|
41
|
|
|
|
|
42
|
|
|
public function setNotifiable(NotifiableInterface $notifiable) |
|
43
|
|
|
{ |
|
44
|
|
|
$this->notifiable = $notifiable; |
|
45
|
|
|
} |
|
46
|
|
|
|
|
47
|
|
|
public function getType() |
|
48
|
|
|
{ |
|
49
|
|
|
return $this->type; |
|
50
|
|
|
} |
|
51
|
|
|
|
|
52
|
|
|
public function setType($type) |
|
53
|
|
|
{ |
|
54
|
|
|
$this->type = $type; |
|
55
|
|
|
} |
|
56
|
|
|
|
|
57
|
|
|
public function getReadAt() |
|
58
|
|
|
{ |
|
59
|
|
|
return $this->readAt; |
|
60
|
|
|
} |
|
61
|
|
|
|
|
62
|
|
|
public function setReadAt(\DateTime $readAt) |
|
63
|
|
|
{ |
|
64
|
|
|
$this->readAt = $readAt; |
|
65
|
|
|
} |
|
66
|
|
|
|
|
67
|
|
|
public function getCreated() |
|
68
|
|
|
{ |
|
69
|
|
|
return $this->created; |
|
70
|
|
|
} |
|
71
|
|
|
|
|
72
|
|
|
public function getUpdated() |
|
73
|
|
|
{ |
|
74
|
|
|
return $this->updated; |
|
75
|
|
|
} |
|
76
|
|
|
|
|
77
|
|
|
public function getTitle() |
|
78
|
|
|
{ |
|
79
|
|
|
return $this->title; |
|
80
|
|
|
} |
|
81
|
|
|
|
|
82
|
|
|
public function setTitle($title) |
|
83
|
|
|
{ |
|
84
|
|
|
$this->title = $title; |
|
85
|
|
|
} |
|
86
|
|
|
|
|
87
|
|
|
public function getBody() |
|
88
|
|
|
{ |
|
89
|
|
|
return $this->body; |
|
90
|
|
|
} |
|
91
|
|
|
|
|
92
|
|
|
public function setBody($body) |
|
93
|
|
|
{ |
|
94
|
|
|
$this->body = $body; |
|
95
|
|
|
} |
|
96
|
|
|
|
|
97
|
|
|
public function updated() |
|
98
|
|
|
{ |
|
99
|
|
|
$updated = new \DateTime(); |
|
100
|
|
|
$this->updated = $updated; |
|
101
|
|
|
} |
|
102
|
|
|
|
|
103
|
|
|
public function prePersist() |
|
104
|
|
|
{ |
|
105
|
|
|
$date = new \DateTime(); |
|
106
|
|
|
$this->created = $date; |
|
107
|
|
|
$this->updated = $date; |
|
108
|
|
|
} |
|
109
|
|
|
|
|
110
|
|
|
public function markAsRead() |
|
111
|
|
|
{ |
|
112
|
|
|
// TODO: Implement markAsRead() method. |
|
113
|
|
|
} |
|
114
|
|
|
|
|
115
|
|
|
public function isRead() |
|
116
|
|
|
{ |
|
117
|
|
|
// TODO: Implement isRead() method. |
|
118
|
|
|
} |
|
119
|
|
|
|
|
120
|
|
|
public function isUnread() |
|
121
|
|
|
{ |
|
122
|
|
|
// TODO: Implement isUnread() method. |
|
123
|
|
|
} |
|
124
|
|
|
} |