eZPublishCommunityProject  2013.9
eZ\Publish\Core\Persistence\Legacy\Content\Search\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\Persistence\Legacy\Content\Search\Handler:
+ Collaboration diagram for eZ\Publish\Core\Persistence\Legacy\Content\Search\Handler:

Public Member Functions

 __construct (Gateway $gateway, ContentMapper $contentMapper, FieldHandler $fieldHandler)
 Creates a new content handler. More...
 
 deleteContent ($contentId, $versionId=null)
 Deletes a content object from the index. More...
 
 deleteLocation ($locationId)
 Deletes a location from the index. More...
 
 findContent (Query $query, array $fieldFilters=array())
 Finds content objects for the given query. More...
 
 findSingle (Criterion $criterion, array $fieldFilters=array())
 Performs a query for a single content object. More...
 
 indexContent (Content $content)
 Indexes a content object. More...
 
 suggest ($prefix, $fieldPaths=array(), $limit=10, Criterion $filter=null)
 Suggests a list of values for the given prefix. More...
 

Protected Attributes

 $contentMapper
 
 $fieldHandler
 
 $gateway
 

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 convertedd in to database statements.

Constructor & Destructor Documentation

eZ\Publish\Core\Persistence\Legacy\Content\Search\Handler::__construct ( Gateway  $gateway,
ContentMapper  $contentMapper,
FieldHandler  $fieldHandler 
)

Creates a new content handler.

Parameters
\eZ\Publish\Core\Persistence\Legacy\Content\Search\Gateway$gateway
\eZ\Publish\Core\Persistence\Legacy\Content\Mapper$contentMapper
\eZ\Publish\Core\Persistence\Legacy\Content\FieldHandler$fieldHandler

Member Function Documentation

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

Deletes a content object from the index.

Parameters
int$contentId
int | null$versionId
Returns
void

Implements eZ\Publish\SPI\Persistence\Content\Search\Handler.

eZ\Publish\Core\Persistence\Legacy\Content\Search\Handler::deleteLocation (   $locationId)

Deletes a location from the index.

Parameters
mixed$locationId

Implements eZ\Publish\SPI\Persistence\Content\Search\Handler.

eZ\Publish\Core\Persistence\Legacy\Content\Search\Handler::findContent ( Query  $query,
array  $fieldFilters = array() 
)

Finds content objects for the given query.

Todo:
define structs for the field filters
Exceptions
\eZ\Publish\API\Repository\Exceptions\InvalidArgumentExceptionif Query criterion is not applicable to its target
Parameters
\eZ\Publish\API\Repository\Values\Content\Query$query
array$fieldFilters- a map of filters for the returned fields. Currently supported: array("languages" => array(<language1>,..)).
Returns

Implements eZ\Publish\SPI\Persistence\Content\Search\Handler.

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

eZ\Publish\Core\Persistence\Legacy\Content\Search\Handler::findSingle ( Criterion  $criterion,
array  $fieldFilters = array() 
)

Performs a query for a single content object.

Exceptions
\eZ\Publish\API\Repository\Exceptions\NotFoundExceptionif the object was not found by the query or due to permissions
\eZ\Publish\API\Repository\Exceptions\InvalidArgumentExceptionif Criterion is not applicable to its target
\eZ\Publish\API\Repository\Exceptions\InvalidArgumentExceptionif there is more than than one result matching the criterions
Todo:
define structs for the field filters
Parameters
\eZ\Publish\API\Repository\Values\Content\Query\Criterion$criterion
array$fieldFilters- a map of filters for the returned fields. Currently supported: array("languages" => array(<language1>,..)).
Returns

Implements eZ\Publish\SPI\Persistence\Content\Search\Handler.

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

Indexes a content object.

Parameters
\eZ\Publish\SPI\Persistence\Content$content
Returns
void

Implements eZ\Publish\SPI\Persistence\Content\Search\Handler.

eZ\Publish\Core\Persistence\Legacy\Content\Search\Handler::suggest (   $prefix,
  $fieldPaths = array(),
  $limit = 10,
Criterion  $filter = null 
)

Suggests a list of values for the given prefix.

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

Implements eZ\Publish\SPI\Persistence\Content\Search\Handler.

Member Data Documentation

eZ\Publish\Core\Persistence\Legacy\Content\Search\Handler::$contentMapper
protected
eZ\Publish\Core\Persistence\Legacy\Content\Search\Handler::$fieldHandler
protected
eZ\Publish\Core\Persistence\Legacy\Content\Search\Handler::$gateway
protected

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