File tree Expand file tree Collapse file tree 3 files changed +45
-0
lines changed Expand file tree Collapse file tree 3 files changed +45
-0
lines changed Original file line number Diff line number Diff line change 30
30
class Comment
31
31
{
32
32
/**
33
+ * @var int
34
+ *
33
35
* @ORM\Id
34
36
* @ORM\GeneratedValue
35
37
* @ORM\Column(type="integer")
36
38
*/
37
39
private $ id ;
38
40
39
41
/**
42
+ * @var Post
43
+ *
40
44
* @ORM\ManyToOne(targetEntity="Post", inversedBy="comments")
41
45
* @ORM\JoinColumn(nullable=false)
42
46
*/
43
47
private $ post ;
44
48
45
49
/**
50
+ * @var string
51
+ *
46
52
* @ORM\Column(type="text")
47
53
* @Assert\NotBlank(message="comment.blank")
48
54
* @Assert\Length(
@@ -55,12 +61,16 @@ class Comment
55
61
private $ content ;
56
62
57
63
/**
64
+ * @var string
65
+ *
58
66
* @ORM\Column(type="string")
59
67
* @Assert\Email()
60
68
*/
61
69
private $ authorEmail ;
62
70
63
71
/**
72
+ * @var \DateTime
73
+ *
64
74
* @ORM\Column(type="datetime")
65
75
* @Assert\DateTime()
66
76
*/
@@ -90,6 +100,7 @@ public function getContent()
90
100
{
91
101
return $ this ->content ;
92
102
}
103
+
93
104
public function setContent ($ content )
94
105
{
95
106
$ this ->content = $ content ;
@@ -99,6 +110,7 @@ public function getAuthorEmail()
99
110
{
100
111
return $ this ->authorEmail ;
101
112
}
113
+
102
114
public function setAuthorEmail ($ authorEmail )
103
115
{
104
116
$ this ->authorEmail = $ authorEmail ;
@@ -108,6 +120,7 @@ public function getPublishedAt()
108
120
{
109
121
return $ this ->publishedAt ;
110
122
}
123
+
111
124
public function setPublishedAt (\DateTime $ publishedAt )
112
125
{
113
126
$ this ->publishedAt = $ publishedAt ;
@@ -117,6 +130,7 @@ public function getPost()
117
130
{
118
131
return $ this ->post ;
119
132
}
133
+
120
134
public function setPost (Post $ post )
121
135
{
122
136
$ this ->post = $ post ;
Original file line number Diff line number Diff line change 22
22
class Post
23
23
{
24
24
/**
25
+ * @var int
26
+ *
25
27
* Use constants to define configuration options that rarely change instead
26
28
* of specifying them in app/config/config.yml.
27
29
* See http://symfony.com/doc/current/best_practices/configuration.html#constants-vs-configuration-options
28
30
*/
29
31
const NUM_ITEMS = 10 ;
30
32
31
33
/**
34
+ * @var int
35
+ *
32
36
* @ORM\Id
33
37
* @ORM\GeneratedValue
34
38
* @ORM\Column(type="integer")
35
39
*/
36
40
private $ id ;
37
41
38
42
/**
43
+ * @var string
44
+ *
39
45
* @ORM\Column(type="string")
40
46
* @Assert\NotBlank()
41
47
*/
42
48
private $ title ;
43
49
44
50
/**
51
+ * @var string
52
+ *
45
53
* @ORM\Column(type="string")
46
54
*/
47
55
private $ slug ;
48
56
49
57
/**
58
+ * @var string
59
+ *
50
60
* @ORM\Column(type="string")
51
61
* @Assert\NotBlank(message="post.blank_summary")
52
62
*/
53
63
private $ summary ;
54
64
55
65
/**
66
+ * @var string
67
+ *
56
68
* @ORM\Column(type="text")
57
69
* @Assert\NotBlank(message="post.blank_content")
58
70
* @Assert\Length(min = "10", minMessage = "post.too_short_content")
59
71
*/
60
72
private $ content ;
61
73
62
74
/**
75
+ * @var string
76
+ *
63
77
* @ORM\Column(type="string")
64
78
* @Assert\Email()
65
79
*/
66
80
private $ authorEmail ;
67
81
68
82
/**
83
+ * @var \DateTime
84
+ *
69
85
* @ORM\Column(type="datetime")
70
86
* @Assert\DateTime()
71
87
*/
72
88
private $ publishedAt ;
73
89
74
90
/**
91
+ * @var Comment[]|ArrayCollection
92
+ *
75
93
* @ORM\OneToMany(
76
94
* targetEntity="Comment",
77
95
* mappedBy="post",
Original file line number Diff line number Diff line change 21
21
class User implements UserInterface
22
22
{
23
23
/**
24
+ * @var int
25
+ *
24
26
* @ORM\Id
25
27
* @ORM\GeneratedValue
26
28
* @ORM\Column(type="integer")
27
29
*/
28
30
private $ id ;
29
31
30
32
/**
33
+ * @var string
34
+ *
31
35
* @ORM\Column(type="string", unique=true)
32
36
*/
33
37
private $ username ;
34
38
35
39
/**
40
+ * @var string
41
+ *
36
42
* @ORM\Column(type="string", unique=true)
37
43
*/
38
44
private $ email ;
39
45
40
46
/**
47
+ * @var string
48
+ *
41
49
* @ORM\Column(type="string")
42
50
*/
43
51
private $ password ;
44
52
45
53
/**
54
+ * @var array
55
+ *
46
56
* @ORM\Column(type="json_array")
47
57
*/
48
58
private $ roles = [];
@@ -59,6 +69,7 @@ public function getUsername()
59
69
{
60
70
return $ this ->username ;
61
71
}
72
+
62
73
public function setUsername ($ username )
63
74
{
64
75
$ this ->username = $ username ;
@@ -68,6 +79,7 @@ public function getEmail()
68
79
{
69
80
return $ this ->email ;
70
81
}
82
+
71
83
public function setEmail ($ email )
72
84
{
73
85
$ this ->email = $ email ;
@@ -80,6 +92,7 @@ public function getPassword()
80
92
{
81
93
return $ this ->password ;
82
94
}
95
+
83
96
public function setPassword ($ password )
84
97
{
85
98
$ this ->password = $ password ;
You can’t perform that action at this time.
0 commit comments