Conditions | 3 |
Paths | 3 |
Total Lines | 28 |
Code Lines | 20 |
Lines | 0 |
Ratio | 0 % |
Changes | 3 | ||
Bugs | 1 | Features | 1 |
1 | <?php |
||
37 | public function load(ObjectManager $manager) |
||
38 | { |
||
39 | $comment_class = $this->container->getParameter('mykees_comment.comment.class'); |
||
40 | |||
41 | for($i=1; $i<=5 ;$i++) |
||
42 | { |
||
43 | $comment = new $comment_class(); |
||
44 | $comment->setUsername('admin'.$i); |
||
45 | $comment->setEmail("admin-{$i}@gmail.com"); |
||
46 | $comment->setContent('contenu n-'.$i); |
||
47 | $comment->setCreatedAt(new \DateTime()); |
||
48 | $comment->setModel('Post'); |
||
49 | if($i <= 3) |
||
50 | { |
||
51 | $comment->setModelId(1); |
||
52 | }else{ |
||
53 | $comment->setModelId($i); |
||
54 | } |
||
55 | $comment->setParentId(0); |
||
56 | $comment->setSpam(0); |
||
57 | $comment->setIp("192.168.56.1"); |
||
58 | $comment->setDepth(0); |
||
59 | $comment->setDepthReached(0); |
||
60 | |||
61 | $manager->persist($comment); |
||
62 | $manager->flush(); |
||
63 | } |
||
64 | } |
||
65 | } |