eZ\Publish\Core\Search\Elasticsearch\Content\Mapper\StandardMapper::mapContentLocation PHP Method

mapContentLocation() protected method

Returned Location Document is to be used as nested Document of a Content, not searchable directly but only through Content Search.
protected mapContentLocation ( eZ\Publish\SPI\Persistence\Content\Location $location, eZ\Publish\SPI\Persistence\Content $content ) : Document
$location eZ\Publish\SPI\Persistence\Content\Location
$content eZ\Publish\SPI\Persistence\Content
return eZ\Publish\Core\Search\Elasticsearch\Content\Document
    protected function mapContentLocation(Location $location, Content $content)
    {
        $fields = array(new Field('id', $location->id, new FieldType\IdentifierField()), new Field('priority', $location->priority, new FieldType\IntegerField()), new Field('hidden', $location->hidden, new FieldType\BooleanField()), new Field('invisible', $location->invisible, new FieldType\BooleanField()), new Field('remote_id', $location->remoteId, new FieldType\IdentifierField()), new Field('parent_id', $location->parentId, new FieldType\IdentifierField()), new Field('path_string', $location->pathString, new FieldType\IdentifierField()), new Field('depth', $location->depth, new FieldType\IntegerField()), new Field('sort_field', $location->sortField, new FieldType\IdentifierField()), new Field('sort_order', $location->sortOrder, new FieldType\IdentifierField()), new Field('is_main_location', $location->id == $content->versionInfo->contentInfo->mainLocationId, new FieldType\BooleanField()));
        return new Document(array('fields' => $fields));
    }