The SSH host key has changed on 8 April, 2022 to this one: SHA256:573uTBSeh74kvOo0HJXi5ijdzRm8me27suzNEDlGyrQ

Next try to update the last post field in ForumTopic and ForumTopicGroup

master
Polonkai Gergely 11 years ago
parent de42154b51
commit 0fad11ffd0
  1. 4
      src/KekRozsak/FrontBundle/Controller/ForumController.php
  2. 8
      src/KekRozsak/FrontBundle/Entity/ForumPost.php
  3. 3
      src/KekRozsak/FrontBundle/Entity/ForumTopic.php

@ -63,14 +63,10 @@ class ForumController extends Controller
$post->setCreatedAt(new \DateTime('now'));
$post->setCreatedBy($this->get('security.context')->getToken()->getUser());
$post->setTopic($topic);
$topicGroup->setLastPost($post);
$topic->setLastPost($post);
$em = $this->getDoctrine()->getEntityManager();
$em->persist($post);
// FIXME: Make this next 2 lines work!
$em->persist($topic);
$em->persist($topicGroup);
$em->flush();
return $this->redirect($this->generateUrl('KekRozsakFrontBundle_forum_post_list', array(

@ -4,6 +4,9 @@ namespace KekRozsak\FrontBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use KekRozsak\FrontBundle\Entity\ForumTopic;
use KekRozsak\FrontBundle\Entity\ForumTopicGroup;
/**
* KekRozsak\FrontBundle\Entity\ForumPost
*/
@ -195,12 +198,13 @@ class ForumPost
/**
* Set topic
*
* @param KekRozsak\FrontBundle\Entity\ForumTopic $topic
* @param ForumTopic $topic
* @return ForumPost
*/
public function setTopic(\KekRozsak\FrontBundle\Entity\ForumTopic $topic = null)
public function setTopic(ForumTopic $topic)
{
$this->topic = $topic;
$topic->setLastPost($this);
return $this;
}

@ -283,9 +283,10 @@ class ForumTopic
* @param KekRozsak\FrontBundle\Entity\ForumPost $lastPost
* @return ForumTopic
*/
public function setLastPost(\KekRozsak\FrontBundle\Entity\ForumPost $lastPost = null)
public function setLastPost(\KekRozsak\FrontBundle\Entity\ForumPost $lastPost)
{
$this->lastPost = $lastPost;
$this->topic_group->setLastPost($lastPost);
return $this;
}

Loading…
Cancel
Save