@@ -29,49 +29,65 @@ class Post
29
29
const NUM_ITEMS = 10 ;
30
30
31
31
/**
32
+ * @var int
33
+ *
32
34
* @ORM\Id
33
35
* @ORM\GeneratedValue
34
36
* @ORM\Column(type="integer")
35
37
*/
36
38
private $ id ;
37
39
38
40
/**
41
+ * @var string
42
+ *
39
43
* @ORM\Column(type="string")
40
44
* @Assert\NotBlank()
41
45
*/
42
46
private $ title ;
43
47
44
48
/**
49
+ * @var string
50
+ *
45
51
* @ORM\Column(type="string")
46
52
*/
47
53
private $ slug ;
48
54
49
55
/**
56
+ * @var string
57
+ *
50
58
* @ORM\Column(type="string")
51
59
* @Assert\NotBlank(message="post.blank_summary")
52
60
*/
53
61
private $ summary ;
54
62
55
63
/**
64
+ * @var string
65
+ *
56
66
* @ORM\Column(type="text")
57
67
* @Assert\NotBlank(message="post.blank_content")
58
68
* @Assert\Length(min = "10", minMessage = "post.too_short_content")
59
69
*/
60
70
private $ content ;
61
71
62
72
/**
73
+ * @var string
74
+ *
63
75
* @ORM\Column(type="string")
64
76
* @Assert\Email()
65
77
*/
66
78
private $ authorEmail ;
67
79
68
80
/**
81
+ * @var \DateTime
82
+ *
69
83
* @ORM\Column(type="datetime")
70
84
* @Assert\DateTime()
71
85
*/
72
86
private $ publishedAt ;
73
87
74
88
/**
89
+ * @var Comment[]|ArrayCollection
90
+ *
75
91
* @ORM\OneToMany(
76
92
* targetEntity="Comment",
77
93
* mappedBy="post",
@@ -97,6 +113,9 @@ public function getTitle()
97
113
return $ this ->title ;
98
114
}
99
115
116
+ /**
117
+ * @param string $title
118
+ */
100
119
public function setTitle ($ title )
101
120
{
102
121
$ this ->title = $ title ;
@@ -107,6 +126,9 @@ public function getSlug()
107
126
return $ this ->slug ;
108
127
}
109
128
129
+ /**
130
+ * @param string $slug
131
+ */
110
132
public function setSlug ($ slug )
111
133
{
112
134
$ this ->slug = $ slug ;
@@ -117,6 +139,9 @@ public function getContent()
117
139
return $ this ->content ;
118
140
}
119
141
142
+ /**
143
+ * @param string $content
144
+ */
120
145
public function setContent ($ content )
121
146
{
122
147
$ this ->content = $ content ;
@@ -127,17 +152,16 @@ public function getAuthorEmail()
127
152
return $ this ->authorEmail ;
128
153
}
129
154
155
+ /**
156
+ * @param string $authorEmail
157
+ */
130
158
public function setAuthorEmail ($ authorEmail )
131
159
{
132
160
$ this ->authorEmail = $ authorEmail ;
133
161
}
134
162
135
163
/**
136
164
* Is the given User the author of this Post?
137
- *
138
- * @param User $user
139
- *
140
- * @return bool
141
165
*/
142
166
public function isAuthor (User $ user )
143
167
{
@@ -175,6 +199,9 @@ public function getSummary()
175
199
return $ this ->summary ;
176
200
}
177
201
202
+ /**
203
+ * @param string $summary
204
+ */
178
205
public function setSummary ($ summary )
179
206
{
180
207
$ this ->summary = $ summary ;
0 commit comments