|
|
@@ -8,6 +8,7 @@ use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
|
|
8
|
8
|
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
|
9
|
9
|
use Symfony\Component\DependencyInjection\ContainerInterface;
|
|
10
|
10
|
use Muzich\CoreBundle\Entity\Element;
|
|
|
11
|
+use Muzich\CoreBundle\Managers\CommentsManager;
|
|
11
|
12
|
|
|
12
|
13
|
class LoadElementData extends AbstractFixture implements OrderedFixtureInterface, ContainerAwareInterface
|
|
13
|
14
|
{
|
|
|
@@ -38,7 +39,7 @@ class LoadElementData extends AbstractFixture implements OrderedFixtureInterfac
|
|
38
|
39
|
/**
|
|
39
|
40
|
*
|
|
40
|
41
|
*/
|
|
41
|
|
- protected function createElement($reference_id, $name, $url, $tags, $type, $owner, $group = null, $date = null)
|
|
|
42
|
+ protected function createElement($reference_id, $name, $url, $tags, $type, $owner, $group = null, $date = null, $comments = null)
|
|
42
|
43
|
{
|
|
43
|
44
|
$element = new Element();
|
|
44
|
45
|
$element->setName(ucfirst($name));
|
|
|
@@ -60,6 +61,8 @@ class LoadElementData extends AbstractFixture implements OrderedFixtureInterfac
|
|
60
|
61
|
$element->addTag($tag);
|
|
61
|
62
|
}
|
|
62
|
63
|
|
|
|
64
|
+ $element->setComments($comments);
|
|
|
65
|
+
|
|
63
|
66
|
$this->entity_manager->persist($element);
|
|
64
|
67
|
}
|
|
65
|
68
|
|
|
|
@@ -195,22 +198,49 @@ class LoadElementData extends AbstractFixture implements OrderedFixtureInterfac
|
|
195
|
198
|
'youtube.com', $bux, null, $this->dateD(183)
|
|
196
|
199
|
);
|
|
197
|
200
|
|
|
|
201
|
+ $cm = new CommentsManager();
|
|
|
202
|
+ $cm->add($joelle, "J'aime bien quand ça tape. Ca rapelle ".
|
|
|
203
|
+ "le grincement sinistre des volets de vieilles".
|
|
|
204
|
+ "maisons. D'ailleur j'ai repeint mon mur des shiots !", $this->dateD(180));
|
|
|
205
|
+
|
|
198
|
206
|
$this->createElement('azyd_azylum_1', 'AZYD AZYLUM Live au Café Provisoire',
|
|
199
|
207
|
'http://www.youtube.com/watch?v=8AXhRXAt2E4',
|
|
200
|
208
|
$this->getArrayOfTag(array('metal')),
|
|
201
|
|
- 'youtube.com', $bux, null, $this->dateD(182)
|
|
|
209
|
+ 'youtube.com', $bux, null, $this->dateD(182),
|
|
|
210
|
+ $cm->get()
|
|
202
|
211
|
);
|
|
203
|
212
|
|
|
|
213
|
+ $cm = new CommentsManager();
|
|
|
214
|
+ $cm->add($bux, "Je commenteuuh nanana 1", $this->dateD(180));
|
|
|
215
|
+ $cm->add($paul, "Je répond 2", $this->dateD(180));
|
|
|
216
|
+ $cm->add($bux, "Je répond 3", $this->dateD(179));
|
|
|
217
|
+ $cm->add($paul, "Je répond 4", $this->dateD(178));
|
|
|
218
|
+ $cm->add($bux, "Je répond 5", $this->dateD(177));
|
|
|
219
|
+ $cm->add($paul, "Je répond 6", $this->dateD(176));
|
|
|
220
|
+ $cm->add($bux, "Je répond 7", $this->dateD(175));
|
|
|
221
|
+ $cm->add($paul, "Je répond 8", $this->dateD(174));
|
|
|
222
|
+ $cm->add($bux, "Je répond 9", $this->dateD(173));
|
|
|
223
|
+ $cm->add($paul, "Je répond 10", $this->dateD(172));
|
|
|
224
|
+ $cm->add($bux, "Je répond 11", $this->dateD(161));
|
|
|
225
|
+ $cm->add($paul, "Je répond 12", $this->dateD(150));
|
|
|
226
|
+ $cm->add($bux, "Je répond 13", $this->dateD(140));
|
|
|
227
|
+
|
|
204
|
228
|
$this->createElement('babylon_pression_1', 'Babylon Pression - Des Tasers et des Pauvres',
|
|
205
|
229
|
'http://www.youtube.com/watch?v=XWkbaHxRvds&feature=related',
|
|
206
|
230
|
$this->getArrayOfTag(array('metal', 'hardcore')),
|
|
207
|
|
- 'youtube.com', $bux, null, $this->dateD(181)
|
|
|
231
|
+ 'youtube.com', $bux, null, $this->dateD(181),
|
|
|
232
|
+ $cm->get()
|
|
208
|
233
|
);
|
|
209
|
234
|
|
|
|
235
|
+ $cm = new CommentsManager();
|
|
|
236
|
+ $cm->add($bux, "C'est trop bon hein ?", $this->dateD(180));
|
|
|
237
|
+ $cm->add($paul, "C'est pas mal en effet", $this->dateD(180));
|
|
|
238
|
+
|
|
210
|
239
|
$this->createElement('ed_cox_1', 'Ed Cox - La fanfare des teuffeurs (Hardcordian)',
|
|
211
|
240
|
'http://www.youtube.com/watch?v=Lk1gnh-JCDs&feature=related',
|
|
212
|
241
|
$this->getArrayOfTag(array('electro')),
|
|
213
|
|
- 'youtube.com', $bux, null, $this->dateD(180)
|
|
|
242
|
+ 'youtube.com', $bux, null, $this->dateD(180),
|
|
|
243
|
+ $cm->get()
|
|
214
|
244
|
);
|
|
215
|
245
|
|
|
216
|
246
|
|