Exponential 5.x Kernel 7.5.40 Exponential New Stack (Symfony-based) Kernel — PHP Class Reference

Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
eZ\Publish\Core\Search\Legacy\Content\Handler Class Reference

The Content Search handler retrieves sets of of Content objects, based on a set of criteria. More...

Inheritance diagram for eZ\Publish\Core\Search\Legacy\Content\Handler:

## Public Member Functions
| __construct (Gateway $gateway, LocationGateway $locationGateway, WordIndexerGateway $indexerGateway, ContentMapper $contentMapper, LocationMapper $locationMapper, LanguageHandler $languageHandler, FullTextMapper $mapper)
| Creates a new content handler. More...
| findContent (Query $query, array $languageFilter=[])
| Finds content objects for the given query. More...
| findSingle (Criterion $filter, array $languageFilter=[])
| Performs a query for a single content object. More...
| findLocations (LocationQuery $query, array $languageFilter=[])
| suggest ($prefix, $fieldPaths=[], $limit=10, Criterion $filter=null)
| Suggests a list of values for the given prefix. More...
| indexContent (Content $content)
| Indexes a content object. More...
| bulkIndex (array $contentList, callable $errorCallback)
| Bulk index list of content objects. More...
| indexLocation (Location $location)
| deleteContent ($contentId, $versionId=null)
| Deletes a content object from the index. More...
| deleteLocation ($locationId, $contentId)
| Deletes a location from the index. More...
| purgeIndex ()
| Purges all contents from the index. More...
| commit ($flush=false)
| Commits the data to the index, making it available for search. More...

## Protected Member Functions
| extractMatchedLanguage ($languageMask, $mainLanguageId, $languageSettings)

## Protected Attributes
| $gateway
| $locationGateway
| $indexerGateway
| $contentMapper
| $locationMapper
| $languageHandler
| $mapper

## Detailed Description

The Content Search handler retrieves sets of of Content objects, based on a set of criteria.

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.

Definition at line 48 of file Core/Search/Legacy/Content/Handler.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZ\Publish\Core\Search\Legacy\Content\Handler::__construct | ( | Gateway | $gateway,
|  | LocationGateway | $locationGateway,
|  | WordIndexerGateway | $indexerGateway,
|  | ContentMapper | $contentMapper,
|  | LocationMapper | $locationMapper,
|  | LanguageHandler | $languageHandler,
|  | FullTextMapper | $mapper
| ) |  |

Creates a new content handler.

Parameters

  \eZ\Publish\Core\Search\Legacy\Content\Gateway | $gateway |
  \eZ\Publish\Core\Search\Legacy\Content\Location\Gateway | $locationGateway |
  \eZ\Publish\Core\Search\Legacy\Content\WordIndexer\Gateway | $indexerGateway |
  \eZ\Publish\Core\Persistence\Legacy\Content\Mapper | $contentMapper |
  \eZ\Publish\Core\Persistence\Legacy\Content\Location\Mapper | $locationMapper |
  \eZ\Publish\SPI\Persistence\Content\Language\Handler | $languageHandler |
  \eZ\Publish\Core\Search\Legacy\Content\Mapper\FullTextMapper | $mapper |

Definition at line 110 of file Core/Search/Legacy/Content/Handler.php.

References eZ\Publish\Core\Search\Legacy\Content\Handler\$contentMapper, eZ\Publish\Core\Search\Legacy\Content\Handler\$gateway, eZ\Publish\Core\Search\Legacy\Content\Handler\$indexerGateway, eZ\Publish\Core\Search\Legacy\Content\Handler\$languageHandler, eZ\Publish\Core\Search\Legacy\Content\Handler\$locationGateway, eZ\Publish\Core\Search\Legacy\Content\Handler\$locationMapper, and eZ\Publish\Core\Search\Legacy\Content\Handler\$mapper.

## Member Function Documentation

## ◆ bulkIndex()

eZ\Publish\Core\Search\Legacy\Content\Handler::bulkIndex | ( | array | $contentList,
|  | callable | $errorCallback
| ) |  |

Bulk index list of content objects.

Parameters

  \eZ\Publish\SPI\Persistence\Content[] | $contentList |
  callable | $errorCallback | (Content $content, NotFoundException $e)

Definition at line 337 of file Core/Search/Legacy/Content/Handler.php.

## ◆ commit()

eZ\Publish\Core\Search\Legacy\Content\Handler::commit | ( |  | $flush = `false` | ) |

Commits the data to the index, making it available for search.

Parameters

  bool | $flush |

Definition at line 394 of file Core/Search/Legacy/Content/Handler.php.

## ◆ deleteContent()

eZ\Publish\Core\Search\Legacy\Content\Handler::deleteContent | ( |  | $contentId,
|  |  | $versionId = `null`
| ) |  |

Deletes a content object from the index.

Parameters

  int | $contentId |
  int | null | $versionId |

Implements eZ\Publish\SPI\Search\Handler.

Definition at line 365 of file Core/Search/Legacy/Content/Handler.php.

## ◆ deleteLocation()

eZ\Publish\Core\Search\Legacy\Content\Handler::deleteLocation | ( |  | $locationId,
|  |  | $contentId
| ) |  |

Deletes a location from the index.

Parameters

  mixed | $locationId |
  mixed | $contentId |

Implements eZ\Publish\SPI\Search\Handler.

Definition at line 376 of file Core/Search/Legacy/Content/Handler.php.

## ◆ extractMatchedLanguage()

eZ\Publish\Core\Search\Legacy\Content\Handler::extractMatchedLanguage | ( |  | $languageMask,
|  |  | $mainLanguageId,
|  |  | $languageSettings
| ) |  |
| protected

Definition at line 192 of file Core/Search/Legacy/Content/Handler.php.

Referenced by eZ\Publish\Core\Search\Legacy\Content\Handler\findContent(), and eZ\Publish\Core\Search\Legacy\Content\Handler\findLocations().

## ◆ findContent()

eZ\Publish\Core\Search\Legacy\Content\Handler::findContent | ( | Query | $query,
|  | array | $languageFilter = `[]`
| ) |  |

Finds content objects for the given query.

Exceptions

Implements eZ\Publish\SPI\Search\Handler.

Definition at line 141 of file Core/Search/Legacy/Content/Handler.php.

References eZ\Publish\Core\Search\Legacy\Content\Handler\extractMatchedLanguage().

Referenced by eZ\Publish\Core\Search\Legacy\Content\Handler\findSingle().

## ◆ findLocations()

eZ\Publish\Core\Search\Legacy\Content\Handler::findLocations | ( | LocationQuery | $query,
|  | array | $languageFilter = `[]`
| ) |  |

See also
  \eZ\Publish\SPI\Search\Handler::findLocations

Implements eZ\Publish\SPI\Search\Handler.

Definition at line 259 of file Core/Search/Legacy/Content/Handler.php.

References eZ\Publish\Core\Search\Legacy\Content\Handler\extractMatchedLanguage().

## ◆ findSingle()

eZ\Publish\Core\Search\Legacy\Content\Handler::findSingle | ( | Criterion | $filter,
|  | array | $languageFilter = `[]`
| ) |  |

Performs a query for a single content object.

Exceptions

Implements eZ\Publish\SPI\Search\Handler.

Definition at line 226 of file Core/Search/Legacy/Content/Handler.php.

References eZ\Publish\Core\Search\Legacy\Content\Handler\findContent().

## ◆ indexContent()

eZ\Publish\Core\Search\Legacy\Content\Handler::indexContent | ( | Content | $content | ) |

Indexes a content object.

Parameters

  \eZ\Publish\SPI\Persistence\Content | $content |

Implements eZ\Publish\SPI\Search\Handler.

Definition at line 324 of file Core/Search/Legacy/Content/Handler.php.

## ◆ indexLocation()

eZ\Publish\Core\Search\Legacy\Content\Handler::indexLocation | ( | Location | $location | ) |

Parameters

  \eZ\Publish\SPI\Persistence\Content\Location | $location |

Implements eZ\Publish\SPI\Search\Handler.

Definition at line 354 of file Core/Search/Legacy/Content/Handler.php.

## ◆ purgeIndex()

eZ\Publish\Core\Search\Legacy\Content\Handler::purgeIndex | ( |  | ) |

Purges all contents from the index.

Implements eZ\Publish\SPI\Search\Handler.

Definition at line 384 of file Core/Search/Legacy/Content/Handler.php.

## ◆ suggest()

eZ\Publish\Core\Search\Legacy\Content\Handler::suggest | ( |  | $prefix,
|  |  | $fieldPaths = `[]`,
|  |  | $limit = `10`,
|  | Criterion | $filter = `null`
| ) |  |

Suggests a list of values for the given prefix.

Parameters

  string | $prefix |
  string[] | $fieldPaths |
  int | $limit |
  \eZ\Publish\API\Repository\Values\Content\Query\Criterion | $filter |

Exceptions

  NotImplementedException |

Implements eZ\Publish\SPI\Search\Handler.

Definition at line 314 of file Core/Search/Legacy/Content/Handler.php.

## Member Data Documentation

## ◆ $contentMapper

eZ\Publish\Core\Search\Legacy\Content\Handler::$contentMapper
| protected

Definition at line 76 of file Core/Search/Legacy/Content/Handler.php.

Referenced by eZ\Publish\Core\Search\Legacy\Content\Handler\__construct().

## ◆ $gateway

eZ\Publish\Core\Search\Legacy\Content\Handler::$gateway
| protected

Definition at line 55 of file Core/Search/Legacy/Content/Handler.php.

Referenced by eZ\Publish\Core\Search\Legacy\Content\Handler\__construct().

## ◆ $indexerGateway

eZ\Publish\Core\Search\Legacy\Content\Handler::$indexerGateway
| protected

Definition at line 69 of file Core/Search/Legacy/Content/Handler.php.

Referenced by eZ\Publish\Core\Search\Legacy\Content\Handler\__construct().

## ◆ $languageHandler

eZ\Publish\Core\Search\Legacy\Content\Handler::$languageHandler
| protected

Definition at line 90 of file Core/Search/Legacy/Content/Handler.php.

Referenced by eZ\Publish\Core\Search\Legacy\Content\Handler\__construct().

## ◆ $locationGateway

eZ\Publish\Core\Search\Legacy\Content\Handler::$locationGateway
| protected

Definition at line 62 of file Core/Search/Legacy/Content/Handler.php.

Referenced by eZ\Publish\Core\Search\Legacy\Content\Handler\__construct().

## ◆ $locationMapper

eZ\Publish\Core\Search\Legacy\Content\Handler::$locationMapper
| protected

Definition at line 83 of file Core/Search/Legacy/Content/Handler.php.

Referenced by eZ\Publish\Core\Search\Legacy\Content\Handler\__construct().

## ◆ $mapper

eZ\Publish\Core\Search\Legacy\Content\Handler::$mapper
| protected

Definition at line 97 of file Core/Search/Legacy/Content/Handler.php.

Referenced by eZ\Publish\Core\Search\Legacy\Content\Handler\__construct().

The documentation for this class was generated from the following file:

- Core/Search/Legacy/Content/Handler.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.