eZ\Publish\Core\Search\Legacy\Content\Mapper\FullTextMapper::getFullTextValues PHP Method

getFullTextValues() protected method

Returns an array of FullTextValue object containing searchable values of content object fields for the given $content.
protected getFullTextValues ( eZ\Publish\SPI\Persistence\Content $content ) : FullTextValue[]
$content eZ\Publish\SPI\Persistence\Content
return eZ\Publish\Core\Search\Legacy\Content\FullTextValue[]
    protected function getFullTextValues(Content $content)
    {
        $fullTextValues = [];
        foreach ($content->fields as $field) {
            $fieldDefinition = $this->contentTypeHandler->getFieldDefinition($field->fieldDefinitionId, Content\Type::STATUS_DEFINED);
            if (!$fieldDefinition->isSearchable) {
                continue;
            }
            $value = $this->getFullTextFieldValue($field, $fieldDefinition);
            if (empty($value)) {
                continue;
            }
            $fullTextValues[] = new FullTextValue(['id' => $field->id, 'fieldDefinitionId' => $field->fieldDefinitionId, 'fieldDefinitionIdentifier' => $fieldDefinition->identifier, 'languageCode' => $field->languageCode, 'value' => !is_array($value) ? $value : implode(' ', $value)]);
        }
        return $fullTextValues;
    }