File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -18,17 +18,20 @@ class Tweet
18
18
public $ id ;
19
19
20
20
/**
21
- * @Column(type="string")
21
+ * @Column(type="string", length=140 )
22
22
*/
23
- public $ content ;
23
+ public $ content = '' ;
24
24
25
25
/**
26
- * @ManyToOne(targetEntity="User", inversedBy="tweets")
26
+ * @ManyToOne(targetEntity="User", inversedBy="tweets", cascade={"persist"}, fetch="EXTRA_LAZY" )
27
27
*/
28
28
public $ author ;
29
29
30
- public function setAuthor (User $ user )
30
+ /**
31
+ * @param User $author
32
+ */
33
+ public function setAuthor (User $ author )
31
34
{
32
- $ this ->author = $ user ;
35
+ $ this ->user = $ author ;
33
36
}
34
37
}
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ public function setUp()
28
28
{
29
29
$ this ->useModelSet ('tweet ' );
30
30
$ this ->useModelSet ('cms ' );
31
+ $ this ->useModelSet ('tweet ' );
31
32
parent ::setUp ();
32
33
33
34
$ class = $ this ->_em ->getClassMetadata ('Doctrine\Tests\Models\CMS\CmsUser ' );
You can’t perform that action at this time.
0 commit comments