Next try to update the last post field in ForumTopic and ForumTopicGroup
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user