PHP Класс eZ\Publish\Core\Search\Legacy\Content\Handler

The basic idea of this class is to do the following: 1) The find methods retrieve a recursive set of filters, which define which content objects to retrieve from the database. Those may be combined using boolean operators. 2) This recursive criterion definition is visited into a query, which limits the content retrieved from the database. We might not be able to create sensible queries from all criterion definitions. 3) The query might be possible to optimize (remove empty statements), reduce singular and and or constructs… 4) Additionally we might need a post-query filtering step, which filters content objects based on criteria, which could not be converted in to database statements.
Наследование: implements eZ\Publish\SPI\Search\Handler
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$contentMapper eZ\Publish\Core\Persistence\Legacy\Content\Mapper Content mapper.
$gateway Gateway Content locator gateway.
$indexerGateway eZ\Publish\Core\Search\Legacy\Content\WordIndexer\Gateway Word indexer gateway.
$languageHandler eZ\Publish\SPI\Persistence\Content\Language\Handler Language handler.
$locationGateway eZ\Publish\Core\Search\Legacy\Content\Location\Gateway Location locator gateway.
$locationMapper eZ\Publish\Core\Persistence\Legacy\Content\Location\Mapper Location locationMapper.
$mapper eZ\Publish\Core\Search\Legacy\Content\Mapper\FullTextMapper FullText mapper.

Открытые методы

Метод Описание
__construct ( Gateway $gateway, Gateway $locationGateway, Gateway $indexerGateway, Mapper $contentMapper, Mapper $locationMapper, eZ\Publish\SPI\Persistence\Content\Language\Handler $languageHandler, FullTextMapper $mapper ) Creates a new content handler.
bulkIndex ( array $contentList, callable $errorCallback ) Bulk index list of content objects.
commit ( boolean $flush = false ) Commits the data to the index, making it available for search.
deleteContent ( integer $contentId, integer | null $versionId = null ) Deletes a content object from the index.
deleteLocation ( mixed $locationId, mixed $contentId ) Deletes a location from the index.
findContent ( eZ\Publish\API\Repository\Values\Content\Query $query, array $languageFilter = [] ) : eZ\Publish\API\Repository\Values\Content\Search\SearchResult Finds content objects for the given query.
findLocations ( eZ\Publish\API\Repository\Values\Content\LocationQuery $query, array $languageFilter = [] )
findSingle ( eZ\Publish\API\Repository\Values\Content\Query\Criterion $filter, array $languageFilter = [] ) : eZ\Publish\SPI\Persistence\Content\ContentInfo Performs a query for a single content object.
indexContent ( eZ\Publish\SPI\Persistence\Content $content ) Indexes a content object.
indexLocation ( eZ\Publish\SPI\Persistence\Content\Location $location )
purgeIndex ( ) Purges all contents from the index.
suggest ( string $prefix, string[] $fieldPaths = [], integer $limit = 10, eZ\Publish\API\Repository\Values\Content\Query\Criterion $filter = null ) Suggests a list of values for the given prefix.

Защищенные методы

Метод Описание
extractMatchedLanguage ( $languageMask, $mainLanguageId, $languageSettings )

Описание методов

__construct() публичный Метод

Creates a new content handler.
public __construct ( Gateway $gateway, Gateway $locationGateway, Gateway $indexerGateway, Mapper $contentMapper, Mapper $locationMapper, eZ\Publish\SPI\Persistence\Content\Language\Handler $languageHandler, FullTextMapper $mapper )
$gateway Gateway
$locationGateway eZ\Publish\Core\Search\Legacy\Content\Location\Gateway
$indexerGateway eZ\Publish\Core\Search\Legacy\Content\WordIndexer\Gateway
$contentMapper eZ\Publish\Core\Persistence\Legacy\Content\Mapper
$locationMapper eZ\Publish\Core\Persistence\Legacy\Content\Location\Mapper
$languageHandler eZ\Publish\SPI\Persistence\Content\Language\Handler
$mapper eZ\Publish\Core\Search\Legacy\Content\Mapper\FullTextMapper

bulkIndex() публичный Метод

Bulk index list of content objects.
public bulkIndex ( array $contentList, callable $errorCallback )
$contentList array
$errorCallback callable (Content $content, NotFoundException $e)

commit() публичный Метод

Commits the data to the index, making it available for search.
public commit ( boolean $flush = false )
$flush boolean

deleteContent() публичный Метод

Deletes a content object from the index.
public deleteContent ( integer $contentId, integer | null $versionId = null )
$contentId integer
$versionId integer | null

deleteLocation() публичный Метод

Deletes a location from the index.
public deleteLocation ( mixed $locationId, mixed $contentId )
$locationId mixed
$contentId mixed

extractMatchedLanguage() защищенный Метод

protected extractMatchedLanguage ( $languageMask, $mainLanguageId, $languageSettings )

findContent() публичный Метод

Finds content objects for the given query.
public findContent ( eZ\Publish\API\Repository\Values\Content\Query $query, array $languageFilter = [] ) : eZ\Publish\API\Repository\Values\Content\Search\SearchResult
$query eZ\Publish\API\Repository\Values\Content\Query
$languageFilter array - a map of language related filters specifying languages query will be performed on. Also used to define which field languages are loaded for the returned content. Currently supports: array("languages" => array(,..), "useAlwaysAvailable" => bool) useAlwaysAvailable defaults to true to avoid exceptions on missing translations
Результат eZ\Publish\API\Repository\Values\Content\Search\SearchResult

findLocations() публичный Метод

См. также: eZ\Publish\SPI\Search\Handler::findLocations
public findLocations ( eZ\Publish\API\Repository\Values\Content\LocationQuery $query, array $languageFilter = [] )
$query eZ\Publish\API\Repository\Values\Content\LocationQuery
$languageFilter array

findSingle() публичный Метод

Performs a query for a single content object.
public findSingle ( eZ\Publish\API\Repository\Values\Content\Query\Criterion $filter, array $languageFilter = [] ) : eZ\Publish\SPI\Persistence\Content\ContentInfo
$filter eZ\Publish\API\Repository\Values\Content\Query\Criterion
$languageFilter array - a map of language related filters specifying languages query will be performed on. Also used to define which field languages are loaded for the returned content. Currently supports: array("languages" => array(,..), "useAlwaysAvailable" => bool) useAlwaysAvailable defaults to true to avoid exceptions on missing translations
Результат eZ\Publish\SPI\Persistence\Content\ContentInfo

indexContent() публичный Метод

Indexes a content object.
public indexContent ( eZ\Publish\SPI\Persistence\Content $content )
$content eZ\Publish\SPI\Persistence\Content

indexLocation() публичный Метод

public indexLocation ( eZ\Publish\SPI\Persistence\Content\Location $location )
$location eZ\Publish\SPI\Persistence\Content\Location

purgeIndex() публичный Метод

Purges all contents from the index.
public purgeIndex ( )

suggest() публичный Метод

Suggests a list of values for the given prefix.
public suggest ( string $prefix, string[] $fieldPaths = [], integer $limit = 10, eZ\Publish\API\Repository\Values\Content\Query\Criterion $filter = null )
$prefix string
$fieldPaths string[]
$limit integer
$filter eZ\Publish\API\Repository\Values\Content\Query\Criterion

Описание свойств

$contentMapper защищенное свойство

Content mapper.
protected Mapper,eZ\Publish\Core\Persistence\Legacy\Content $contentMapper
Результат eZ\Publish\Core\Persistence\Legacy\Content\Mapper

$gateway защищенное свойство

Content locator gateway.
protected Gateway,eZ\Publish\Core\Search\Legacy\Content $gateway
Результат Gateway

$indexerGateway защищенное свойство

Word indexer gateway.
protected Gateway,eZ\Publish\Core\Search\Legacy\Content\WordIndexer $indexerGateway
Результат eZ\Publish\Core\Search\Legacy\Content\WordIndexer\Gateway

$languageHandler защищенное свойство

Language handler.
protected Handler,eZ\Publish\SPI\Persistence\Content\Language $languageHandler
Результат eZ\Publish\SPI\Persistence\Content\Language\Handler

$locationGateway защищенное свойство

Location locator gateway.
protected Gateway,eZ\Publish\Core\Search\Legacy\Content\Location $locationGateway
Результат eZ\Publish\Core\Search\Legacy\Content\Location\Gateway

$locationMapper защищенное свойство

Location locationMapper.
protected Mapper,eZ\Publish\Core\Persistence\Legacy\Content\Location $locationMapper
Результат eZ\Publish\Core\Persistence\Legacy\Content\Location\Mapper

$mapper защищенное свойство

FullText mapper.
protected FullTextMapper,eZ\Publish\Core\Search\Legacy\Content\Mapper $mapper
Результат eZ\Publish\Core\Search\Legacy\Content\Mapper\FullTextMapper