Ejemplo n.º 1
0
 public function loadPost(Post $post)
 {
     if ($this->isAnonymous()) {
         if ($authorName = $this->request->cookies->get($this->cookieName)) {
             $post->setAuthorName(urldecode($authorName));
         }
     }
 }
Ejemplo n.º 2
0
 protected function addCateg($manager, $name, $description)
 {
     $categ = new Category();
     $categ->setName($name);
     $categ->setDescription($description);
     $topic = new Topic();
     $topic->setSubject('New forum category: ' . $name);
     $topic->setCategory($categ);
     $this->container->get('herzult_forum.creator.topic')->create($topic);
     $post = new Post();
     $post->setMessage($description);
     $post->setAuthorName('lichess.org staff');
     $post->setTopic($topic);
     $this->container->get('herzult_forum.creator.post')->create($post);
     $manager->persist($categ);
     $manager->persist($topic);
     $manager->persist($post);
     return $topic;
 }