Knp\Bundle\KnpBundlesBundle\Indexer\SolrIndexer::updateDocumentFromBundle PHP Method

updateDocumentFromBundle() private method

Populates document with bundle data.
private updateDocumentFromBundle ( Solarium_Document_ReadWrite $document, Bundle $bundle, Solarium_Query_Helper $helper )
$document Solarium_Document_ReadWrite
$bundle Knp\Bundle\KnpBundlesBundle\Entity\Bundle
$helper Solarium_Query_Helper
    private function updateDocumentFromBundle(\Solarium_Document_ReadWrite $document, Bundle $bundle, \Solarium_Query_Helper $helper)
    {
        $document->setField('id', $bundle->getId());
        $document->setField('name', $bundle->getName());
        $document->setField('ownerName', $bundle->getOwnerName());
        $document->setField('ownerType', $bundle->getOwnerType());
        $document->setField('fullName', $bundle->getFullName());
        $document->setField('description', $bundle->getDescription());
        $document->setField('readme', $bundle->getReadme());
        $document->setField('totalScore', $bundle->getScore());
        $document->setField('state', $bundle->getState());
        $document->setField('avatarUrl', $bundle->getOwner()->getAvatarUrl());
        $document->setField('lastCommitAt', $helper->formatDate(clone $bundle->getLastCommitAt()));
        $document->setField('lastTweetedAt', null !== $bundle->getLastTweetedAt() ? $helper->formatDate($bundle->getLastTweetedAt()) : null);
        $keywords = array();
        foreach ($bundle->getKeywords() as $keyword) {
            $keywords[mb_strtolower($keyword->getValue(), 'UTF-8')] = true;
        }
        $document->setField('keywords', array_keys($keywords));
    }