/** * Persists a vote. * * @param VoteInterface $vote * @param VotableCommentInterface $comment * @return void */ public function addVote(VoteInterface $vote, VotableCommentInterface $comment) { $vote->setComment($comment); $comment->incrementScore($vote->getvalue()); $this->em->persist($comment); $this->em->persist($vote); $this->em->flush(); }