Manager/Manager.php
public function subscribe(Forum $forum, User $user, $selfActivation = true)
    {
        $this->om->startFlushSuite();
        $notification = new Notification();
        $notification->setUser($user);
        $notification->setForum($forum);
        $notification->setSelfActivation($selfActivation);
        $this->om->persist($notification);
        $this->dispatch(new SubscribeForumEvent($forum));
        $this->om->endFlushSuite();
    }
public function subscribe(Forum $forum, User $user, $selfActivation = true)
    {
        $this->om->startFlushSuite();
        $notification = new Notification();
        $notification->setUser($user);
        $notification->setForum($forum);
        $notification->setSelfActivation($selfActivation);
        $this->om->persist($notification);
        $this->dispatch(new SubscribeForumEvent($forum));
        $this->om->endFlushSuite();
    }
public function subscribe ( Forum $ forum , User $ user , $ selfActivation = true ) { $ this -> om -> startFlushSuite ( ) ; $ notification = new Notification ( ) ; $ notification -> setUser ( $ user ) ; $ notification -> setForum ( $ forum ) ; $ notification -> setSelfActivation ( $ selfActivation ) ; $ this -> om -> persist ( $ notification ) ; $ this -> dispatch ( new SubscribeForumEvent ( $ forum ) ) ; $ this -> om -> endFlushSuite ( ) ; }
Subscribe a user to a forum. A mail will be sent to the user each time
a message is posted.

@param \Claroline\ForumBundle\Entity\Forum $forum
@param \Claroline\CoreBundle\Entity\User $user
Subscribe a user to a forum . A mail will be sent to the user each time a message is posted .