public function create(CommentCreateEvent $event) { $comment = new Comment(); $comment->setRef($event->getRef())->setRefId($event->getRefId())->setCustomerId($event->getCustomerId())->setUsername($event->getUsername())->setEmail($event->getEmail())->setLocale($event->getLocale())->setTitle($event->getTitle())->setContent($event->getContent())->setStatus($event->getStatus())->setVerified($event->isVerified())->setRating($event->getRating())->setAbuse($event->getAbuse())->save(); $event->setComment($comment); if (Comment::ACCEPTED === $comment->getStatus()) { $this->dispatchRatingCompute($event->getDispatcher(), $comment->getRef(), $comment->getRefId()); } }
/** * Returns the object ID from the object * * @param \Comment\Model\Comment $object */ protected function getObjectId($object) { $object->getId(); }
/** * Exclude object from result * * @param ChildComment $comment Object to remove from the list of results * * @return ChildCommentQuery The current query, for fluid interface */ public function prune($comment = null) { if ($comment) { $this->addUsingAlias(CommentTableMap::ID, $comment->getId(), Criteria::NOT_EQUAL); } return $this; }