src/PHPDish/Bundle/ForumBundle/Service/ReplyManager.php
public function addVoter(ReplyInterface $reply, UserInterface $user)
    {
        $reply->addVoter($user)
            ->addVoteCount();
        $this->entityManager->persist($reply);
        $this->entityManager->flush();

        //触发事件
        $event = new VoteReplyEvent($reply->getTopic(), $reply, $user);
        $this->eventDispatcher->dispatch(Events::REPLY_VOTED, $event);
    }
public function addVoter(ReplyInterface $reply, UserInterface $user)
    {
        $reply->addVoter($user)
            ->addVoteCount();
        $this->entityManager->persist($reply);
        $this->entityManager->flush();

        //触发事件
        $event = new VoteReplyEvent($reply->getTopic(), $reply, $user);
        $this->eventDispatcher->dispatch(Events::REPLY_VOTED, $event);
    }
{@inheritdoc}