eZPublishCommunityProject  2012.12
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...
 
 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...
 
- Public Member Functions inherited from eZ\Publish\SPI\Persistence\Content\Search\Handler
 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::findContent ( Query  $query,
array  $fieldFilters = array() 
)

Finds content objects for the given query.

Todo:
define structs for the field filters
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

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 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
eZ\Publish\Core\Persistence\Legacy\Content\Search\Handler::indexContent ( Content  $content)

Indexes a content object.

Parameters
\eZ\Publish\SPI\Persistence\Content$content
Returns
void
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

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: