public function mapContent(Content $content) { return new FullTextData(['id' => $content->versionInfo->contentInfo->id, 'contentTypeId' => $content->versionInfo->contentInfo->contentTypeId, 'sectionId' => $content->versionInfo->contentInfo->sectionId, 'published' => $content->versionInfo->contentInfo->publicationDate, 'values' => $this->getFullTextValues($content)]); }
/** * Bulk index list of content objects. * * @param \eZ\Publish\SPI\Persistence\Content[] $contentList * @param callable $errorCallback (Content $content, NotFoundException $e) */ public function bulkIndex(array $contentList, callable $errorCallback) { $fullTextBulkData = []; foreach ($contentList as $content) { try { $fullTextBulkData[] = $this->mapper->mapContent($content); } catch (NotFoundException $e) { $errorCallback($content, $e); } } $this->indexerGateway->bulkIndex($fullTextBulkData); }