PHP Class Doctrine\Search\Query

ファイルを表示 Open project: doctrine/search Class Usage Examples

Protected Properties

Property Type Description
$cacheLifetime integer
$count integer
$entityClasses array
$facets array
$hydrationMode integer
$hydrationParameter string
$hydrationQuery object
$query object
$sm Doctrine\Search\SearchManager
$useResultCache boolean

Public Methods

Method Description
__call ( string $method, array $arguments ) Magic method to pass query building to the underlying query object, saving the need to abstract.
__construct ( Doctrine\Search\SearchManager $sm )
addFrom ( string $entityClass ) Add a searchable entity class to search against.
count ( ) Return the total hit count for the given query as provided by the search engine.
from ( mixed $entityClasses ) Specifies the searchable entity class to search against.
getFacets ( ) : array
getResult ( integer $hydrationMode = null ) : mixed Execute search and hydrate results if required.
getSingleResult ( integer $hydrationMode = null ) : mixed Execute search for single result and hydrate results if required.
hydrateWith ( object $hydrationQuery, string $parameter = null ) Set a custom Doctrine Query to execute in order to hydrate the search engine results into required entities. The assumption is made the the search engine result id is correlated to the entity id. An optional query parameter override can be specified.
searchWith ( mixed $query ) Set the query object to be executed on the search engine
setHydrationMode ( integer $mode ) Set the hydration mode from the underlying query modes or bypass and return search result directly from the client
useResultCache ( boolean $useCache, integer $cacheLifetime = null ) If hydrating with Doctrine then you can use the result cache on the default or provided query

Protected Methods

Method Description
getHydrationQuery ( ) : object Return a provided hydration query
getSearchManager ( )

Method Details

__call() public method

Magic method to pass query building to the underlying query object, saving the need to abstract.
public __call ( string $method, array $arguments )
$method string
$arguments array

__construct() public method

public __construct ( Doctrine\Search\SearchManager $sm )
$sm Doctrine\Search\SearchManager

addFrom() public method

Add a searchable entity class to search against.
public addFrom ( string $entityClass )
$entityClass string

count() public method

Return the total hit count for the given query as provided by the search engine.
public count ( )

from() public method

Specifies the searchable entity class to search against.
public from ( mixed $entityClasses )
$entityClasses mixed

getFacets() public method

public getFacets ( ) : array
return array

getHydrationQuery() protected method

Return a provided hydration query
protected getHydrationQuery ( ) : object
return object

getResult() public method

Execute search and hydrate results if required.
public getResult ( integer $hydrationMode = null ) : mixed
$hydrationMode integer
return mixed

getSearchManager() protected method

protected getSearchManager ( )

getSingleResult() public method

Execute search for single result and hydrate results if required.
public getSingleResult ( integer $hydrationMode = null ) : mixed
$hydrationMode integer
return mixed

hydrateWith() public method

Set a custom Doctrine Query to execute in order to hydrate the search engine results into required entities. The assumption is made the the search engine result id is correlated to the entity id. An optional query parameter override can be specified.
public hydrateWith ( object $hydrationQuery, string $parameter = null )
$hydrationQuery object
$parameter string

searchWith() public method

Set the query object to be executed on the search engine
public searchWith ( mixed $query )
$query mixed

setHydrationMode() public method

Set the hydration mode from the underlying query modes or bypass and return search result directly from the client
public setHydrationMode ( integer $mode )
$mode integer

useResultCache() public method

If hydrating with Doctrine then you can use the result cache on the default or provided query
public useResultCache ( boolean $useCache, integer $cacheLifetime = null )
$useCache boolean
$cacheLifetime integer

Property Details

$cacheLifetime protected_oe property

protected int $cacheLifetime
return integer

$count protected_oe property

protected int $count
return integer

$entityClasses protected_oe property

protected array $entityClasses
return array

$facets protected_oe property

protected array $facets
return array

$hydrationMode protected_oe property

protected int $hydrationMode
return integer

$hydrationParameter protected_oe property

protected string $hydrationParameter
return string

$hydrationQuery protected_oe property

protected object $hydrationQuery
return object

$query protected_oe property

protected object $query
return object

$sm protected_oe property

protected SearchManager,Doctrine\Search $sm
return Doctrine\Search\SearchManager

$useResultCache protected_oe property

protected bool $useResultCache
return boolean