Newscoop\Comment\SearchService::getDocument PHP Method

getDocument() public method

Get document for comment
public getDocument ( Newscoop\Search\DocumentInterface $comment ) : array
$comment Newscoop\Search\DocumentInterface
return array
    public function getDocument(DocumentInterface $comment)
    {
        $articleNumber = $comment->getThread();
        $language = $comment->getLanguage();
        $article = $this->em->getRepository('Newscoop\\Entity\\Article')->find(array('number' => $articleNumber, 'language' => $language->getId()));
        return array('id' => $this->getDocumentId($comment), 'number' => $comment->getId(), 'type' => 'comment', 'subject' => $comment->getSubject(), 'message' => $comment->getMessage(), 'published' => gmdate(self::DATE_FORMAT, $comment->getTimeCreated()->getTimestamp()), 'link' => sprintf('%s#comment_%d', $this->articleLinkService->getLink($article), $comment->getId()));
    }