From 47177333f9680ed6450a05cd179d0833a9d1b6b5 Mon Sep 17 00:00:00 2001 From: Polonkai Gergely Date: Sun, 15 Jul 2012 15:30:08 +0200 Subject: [PATCH] Fixed a bug so topics' last post is now refreshed. --- src/KekRozsak/FrontBundle/Entity/ForumPost.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/KekRozsak/FrontBundle/Entity/ForumPost.php b/src/KekRozsak/FrontBundle/Entity/ForumPost.php index 31c13b1..6618a9f 100644 --- a/src/KekRozsak/FrontBundle/Entity/ForumPost.php +++ b/src/KekRozsak/FrontBundle/Entity/ForumPost.php @@ -128,6 +128,8 @@ class ForumPost public function setTopic(ForumTopic $topic) { $this->topic = $topic; + if ($topic->getLastPost()->getCreatedAt() < $this->createdAt) + $topic->setLastPost($this); return $this; }