Newscoop\Entity\Repository\NotificationRepository::addComment PHP Метод

addComment() публичный Метод

Add to notification
public addComment ( Comment $comment ) : unknown_type
$comment Newscoop\Entity\Comment
Результат unknown_type
    public function addComment(Comment $comment)
    {
        $notification = $this->getPrototype();
        // set content of the notification
        $content = array();
        $content[Notification::COMMENT_NAME] = $comment->getCommenterName();
        $content[Notification::COMMENT_EMAIL] = $comment->getCommenterEmail();
        $content[Notification::COMMENT_IP] = $comment->getIp();
        $content[Notification::COMMENT_SUBJECT] = $comment->getSubject();
        $content[Notification::COMMENT_MESSAGE] = $comment->getMessage();
        $content[Notification::COMMENT_PUBLICATION] = $comment->getPublicationId();
        //serialize the content
        $notification->setContent(serialize($content));
        $notification->setType(Notification::TYPE_COMMENT);
        $notification->setStatus(Notification::STATUS_PENDING);
        $this->getEntityManager()->persist($notification);
        $this->flush();
    }