PHP Class eZ\Publish\Core\Search\Elasticsearch\Content\Mapper\StandardMapper

Inheritance: implements eZ\Publish\Core\Search\Elasticsearch\Content\MapperInterface
Show file Open project: ezsystems/ezpublish-kernel

Protected Properties

Property Type Description
$contentHandler eZ\Publish\SPI\Persistence\Content\Handler Content handler.
$contentTypeHandler eZ\Publish\SPI\Persistence\Content\Type\Handler Content type handler.
$fieldNameGenerator eZ\Publish\Core\Search\Common\FieldNameGenerator Field name generator.
$fieldRegistry eZ\Publish\Core\Search\Common\FieldRegistry Field registry.
$locationHandler eZ\Publish\SPI\Persistence\Content\Location\Handler Location handler.
$objectStateHandler eZ\Publish\SPI\Persistence\Content\ObjectState\Handler Object state handler.
$sectionHandler eZ\Publish\SPI\Persistence\Content\Section\Handler Section handler.

Public Methods

Method Description
__construct ( FieldRegistry $fieldRegistry, FieldNameGenerator $fieldNameGenerator, eZ\Publish\SPI\Persistence\Content\Handler $contentHandler, eZ\Publish\SPI\Persistence\Content\Location\Handler $locationHandler, eZ\Publish\SPI\Persistence\Content\Type\Handler $contentTypeHandler, eZ\Publish\SPI\Persistence\Content\ObjectState\Handler $objectStateHandler, eZ\Publish\SPI\Persistence\Content\Section\Handler $sectionHandler )
mapContent ( eZ\Publish\SPI\Persistence\Content $content ) : Document Maps given Content to a Document.
mapContentById ( integer | string $contentId ) : Document Maps given Content by given $contentId to a Document.
mapLocation ( eZ\Publish\SPI\Persistence\Content\Location $location ) : Document Maps given Location to a Document.

Protected Methods

Method Description
getAncestorLocationsContentIds ( integer | string $contentId ) : array Returns Content ids of all ancestor Locations of all Locations of a Content with given $contentId.
getObjectStateIds ( integer | string $contentId ) : array Returns an array of object state ids of a Content with given $contentId.
mapContentLocation ( eZ\Publish\SPI\Persistence\Content\Location $location, eZ\Publish\SPI\Persistence\Content $content ) : Document Maps given $location of a $content to a Document.
mapFields ( eZ\Publish\SPI\Persistence\Content $content, eZ\Publish\SPI\Persistence\Content\Type $contentType ) : Document[] Returns an array of documents containing fields for the given $content.

Method Details

__construct() public method

public __construct ( FieldRegistry $fieldRegistry, FieldNameGenerator $fieldNameGenerator, eZ\Publish\SPI\Persistence\Content\Handler $contentHandler, eZ\Publish\SPI\Persistence\Content\Location\Handler $locationHandler, eZ\Publish\SPI\Persistence\Content\Type\Handler $contentTypeHandler, eZ\Publish\SPI\Persistence\Content\ObjectState\Handler $objectStateHandler, eZ\Publish\SPI\Persistence\Content\Section\Handler $sectionHandler )
$fieldRegistry eZ\Publish\Core\Search\Common\FieldRegistry
$fieldNameGenerator eZ\Publish\Core\Search\Common\FieldNameGenerator
$contentHandler eZ\Publish\SPI\Persistence\Content\Handler
$locationHandler eZ\Publish\SPI\Persistence\Content\Location\Handler
$contentTypeHandler eZ\Publish\SPI\Persistence\Content\Type\Handler
$objectStateHandler eZ\Publish\SPI\Persistence\Content\ObjectState\Handler
$sectionHandler eZ\Publish\SPI\Persistence\Content\Section\Handler

getAncestorLocationsContentIds() protected method

Used to determine user groups of a user with $contentId.
protected getAncestorLocationsContentIds ( integer | string $contentId ) : array
$contentId integer | string
return array

getObjectStateIds() protected method

Returns an array of object state ids of a Content with given $contentId.
protected getObjectStateIds ( integer | string $contentId ) : array
$contentId integer | string
return array

mapContent() public method

Maps given Content to a Document.
public mapContent ( eZ\Publish\SPI\Persistence\Content $content ) : Document
$content eZ\Publish\SPI\Persistence\Content
return eZ\Publish\Core\Search\Elasticsearch\Content\Document

mapContentById() public method

Maps given Content by given $contentId to a Document.
public mapContentById ( integer | string $contentId ) : Document
$contentId integer | string
return eZ\Publish\Core\Search\Elasticsearch\Content\Document

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

mapFields() protected method

Each document contains fields for a single language.
protected mapFields ( eZ\Publish\SPI\Persistence\Content $content, eZ\Publish\SPI\Persistence\Content\Type $contentType ) : Document[]
$content eZ\Publish\SPI\Persistence\Content
$contentType eZ\Publish\SPI\Persistence\Content\Type
return eZ\Publish\Core\Search\Elasticsearch\Content\Document[]

mapLocation() public method

Returned Document represents a "parent" Location document searchable with Location Search.
public mapLocation ( eZ\Publish\SPI\Persistence\Content\Location $location ) : Document
$location eZ\Publish\SPI\Persistence\Content\Location
return eZ\Publish\Core\Search\Elasticsearch\Content\Document

Property Details

$contentHandler protected property

Content handler.
protected Handler,eZ\Publish\SPI\Persistence\Content $contentHandler
return eZ\Publish\SPI\Persistence\Content\Handler

$contentTypeHandler protected property

Content type handler.
protected Handler,eZ\Publish\SPI\Persistence\Content\Type $contentTypeHandler
return eZ\Publish\SPI\Persistence\Content\Type\Handler

$fieldNameGenerator protected property

Field name generator.
protected FieldNameGenerator,eZ\Publish\Core\Search\Common $fieldNameGenerator
return eZ\Publish\Core\Search\Common\FieldNameGenerator

$fieldRegistry protected property

Field registry.
protected FieldRegistry,eZ\Publish\Core\Search\Common $fieldRegistry
return eZ\Publish\Core\Search\Common\FieldRegistry

$locationHandler protected property

Location handler.
protected Handler,eZ\Publish\SPI\Persistence\Content\Location $locationHandler
return eZ\Publish\SPI\Persistence\Content\Location\Handler

$objectStateHandler protected property

Object state handler.
protected Handler,eZ\Publish\SPI\Persistence\Content\ObjectState $objectStateHandler
return eZ\Publish\SPI\Persistence\Content\ObjectState\Handler

$sectionHandler protected property

Section handler.
protected Handler,eZ\Publish\SPI\Persistence\Content\Section $sectionHandler
return eZ\Publish\SPI\Persistence\Content\Section\Handler