eZPublishCommunityProject  2012.12
eZ\Publish\Core\Persistence\InMemory\SearchHandler 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\InMemory\SearchHandler:
+ Collaboration diagram for eZ\Publish\Core\Persistence\InMemory\SearchHandler:

Public Member Functions

 __construct (Handler $handler, Backend $backend)
 Setups current handler instance with reference to Handler object that created it. 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)
 
 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 Member Functions

 generateMatchByCriteria (array $criteria, array &$match)
 Generate match array for use with Backend based on criteria. More...
 

Protected Attributes

 $backend
 
 $handler
 

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.

Constructor & Destructor Documentation

eZ\Publish\Core\Persistence\InMemory\SearchHandler::__construct ( Handler  $handler,
Backend  $backend 
)

Setups current handler instance with reference to Handler object that created it.

Parameters
Handler$handler
Backend$backendThe storage engine backend

Member Function Documentation

eZ\Publish\Core\Persistence\InMemory\SearchHandler::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\InMemory\SearchHandler\findSingle().

eZ\Publish\Core\Persistence\InMemory\SearchHandler::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\InMemory\SearchHandler::generateMatchByCriteria ( array  $criteria,
array &  $match 
)
protected

Generate match array for use with Backend based on criteria.

Parameters
array$criteria
array$match
Returns
void

Referenced by eZ\Publish\Core\Persistence\InMemory\SearchHandler\findContent().

eZ\Publish\Core\Persistence\InMemory\SearchHandler::indexContent ( Content  $content)
See Also
eZ\Publish\Core\Persistence\InMemory\SearchHandler::suggest (   $prefix,
  $fieldPaths = array(),
  $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

Member Data Documentation

eZ\Publish\Core\Persistence\InMemory\SearchHandler::$backend
protected
eZ\Publish\Core\Persistence\InMemory\SearchHandler::$handler
protected

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