private function loadPosts(ObjectManager $manager)
{
foreach (range(1, 30) as $i) {
$post = new Post();
$post->setTitle('Sed ut perspiciatis unde');
$post->setAlias('Sed ut perspiciatis unde');
$post->setIntrotext('Sed ut perspicantium, tocto beatae vitae dicta sunt explicabo. ');
$post->setSlug($this->container->get('slugger')->slugify($post->getTitle()));
$post->setBody('Sed ut is iste uasi architecto beatae vitae dicta sunt explicabo. ');
$post->setAuthorEmail('*****@*****.**');
$post->setPublishedAt(new \DateTime('now - ' . $i . 'days'));
$post->setState(1);
$post->setImages('test.jpg');
foreach (range(1, 5) as $j) {
$comment = new Comment();
$comment->setAuthorEmail('*****@*****.**');
$comment->setPublishedAt(new \DateTime('now + ' . ($i + $j) . 'seconds'));
$comment->setContent('Sed ut perspiciatis undedasdadasd');
$comment->setPost($post);
$manager->persist($comment);
$post->addComment($comment);
}
$manager->persist($post);
}
$manager->flush();
}