class FacetapiTestAdapter in Facet API 7
Same name and namespace in other branches
- 6.3 tests/facetapi_test/plugins/facetapi/test_adapter.inc \FacetapiTestAdapter
- 7.2 tests/facetapi_test.plugins.inc \FacetapiTestAdapter
Adapter for our test searcher.
The test searcher does not connect to a backend, it just renders dummy data every tom a search is executed. Facet API is not responsible for calculating the facets, so for testing purposes this works just fine.
Hierarchy
- class \FacetapiAdapter
- class \FacetapiTestAdapter
Expanded class hierarchy of FacetapiTestAdapter
1 string reference to 'FacetapiTestAdapter'
- facetapi_test_facetapi_adapters in tests/
facetapi_test.facetapi.inc - Implements hook_facetapi_adapters().
File
- tests/
facetapi_test.plugins.inc, line 15 - Test adapter and plugins.
View source
class FacetapiTestAdapter extends FacetapiAdapter {
/**
* The total number of results in the query.
*/
protected $resultCount = 10;
/**
* Implements FacetapiAdapter::searchExecuted().
*/
public function searchExecuted() {
return !empty($this->keys);
}
/**
* Implements FacetapiAdapter::suppressOutput().
*/
public function suppressOutput($realm_name) {
return FALSE;
}
/**
* Overrides FacetapiAdapter::getSearchPath().
*/
public function getSearchPath() {
return 'facetapi_test/search';
}
/**
* Sets the result count.
*
* The test searcher does not use the core pager APIs, so we use this method
* to set a dummy value.
*
* @param int $count
* The result count.
*
* @return FacetapiAdapter
* An instance of this class.
*/
public function setResultCount($count) {
$this->resultCount = $count;
return $this;
}
/**
* Overrides FacetapiAdapter::getResultCount().
*/
public function getResultCount() {
return $this->resultCount;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
FacetapiAdapter:: |
protected | property | An array of active items created by FacetapiAdapter::processActiveItems(). | |
FacetapiAdapter:: |
protected | property | An array of facets that passed their dependencies. | |
FacetapiAdapter:: |
protected | property | An array of FacetapiFacet objects for facets being rendered. | |
FacetapiAdapter:: |
protected | property | The searcher information as returned by facetapi_get_searcher_info(). | |
FacetapiAdapter:: |
protected | property | The search keys, or query text, submitted by the user. | |
FacetapiAdapter:: |
protected | property | A boolean flagging whether the facets have been processed, or built. | |
FacetapiAdapter:: |
protected | property | An array of FacetapiFacetProcessor objects. | |
FacetapiAdapter:: |
protected | property | An array of executed query type plugins keyed by field name. | |
FacetapiAdapter:: |
protected | property | Stores the search path associated with this searcher. | |
FacetapiAdapter:: |
protected | property | Stores settings with defaults. | |
FacetapiAdapter:: |
protected | property | The url processor plugin associated with this adapter. | |
FacetapiAdapter:: |
function | Allows the backend to add facet queries to its native query object. | ||
FacetapiAdapter:: |
public | function | Uses each facet's widget to build the realm's render array. | |
FacetapiAdapter:: |
public | function | Returns a facet's active items. | |
FacetapiAdapter:: |
public | function | Return all active items keyed by raw filter, usually in field:value format. | |
FacetapiAdapter:: |
public | function | Provides default values for the backend specific settings. | |
FacetapiAdapter:: |
public | function | Returns enabled facets for the searcher associated with this adapter. | |
FacetapiAdapter:: |
public | function | Returns a FacetapiFacet instance for the facet being rendered. | |
FacetapiAdapter:: |
public | function | Helper function that returns the path for a facet link. | |
FacetapiAdapter:: |
public | function | Returns the facet's instantiated query type plugin. | |
FacetapiAdapter:: |
public | function | Returns realm specific settings for a facet. | |
FacetapiAdapter:: |
public | function | Returns global settings for a facet. | |
FacetapiAdapter:: |
public | function | Returns the id of the adapter plugin. | |
FacetapiAdapter:: |
public | function | Maps a facet's index value to a human readable value displayed to the user. | |
FacetapiAdapter:: |
public | function | Returns the number of results per page. | |
FacetapiAdapter:: |
public | function | Returns the page number of the search result set. | |
FacetapiAdapter:: |
public | function | Returns the total number of pages in the result set. | |
FacetapiAdapter:: |
public | function | Returns the path to the the realm's admin settings page. | |
FacetapiAdapter:: |
public | function | Returns the processor associated with the facet. | |
FacetapiAdapter:: |
public | function | Helper function that returns the query string variables for a facet item. | |
FacetapiAdapter:: |
public | function | Returns the machine readable name of the searcher. | |
FacetapiAdapter:: |
public | function | Gets the search keys, or query text, submitted by the user. | |
FacetapiAdapter:: |
public | function | Returns the type of content indexed by $this->info['searcher']. | |
FacetapiAdapter:: |
public | function | Return the instantiated url processor plugin. | |
FacetapiAdapter:: |
public | function | Hook that allows the backend to initialize its query object for faceting. | |
FacetapiAdapter:: |
public | function | Initializes a new settings object. | |
FacetapiAdapter:: |
public | function | Extracts, stores, and processes facet data. | |
FacetapiAdapter:: |
public | function | Tests whether a facet item is active by passing it's value. | |
FacetapiAdapter:: |
public | function | Returns an array of instantiated query type plugins for enabled facets. | |
FacetapiAdapter:: |
public | function | Loads the URL processor associated with this adapter. | |
FacetapiAdapter:: |
public | function | Processes active facet items. | |
FacetapiAdapter:: |
public | function | Initializes facet builds, sets the breadcrumb trail. | |
FacetapiAdapter:: |
public | function | Processes and stores the extracted facet data. | |
FacetapiAdapter:: |
public | function | Sets the search keys, or query text, submitted by the user. | |
FacetapiAdapter:: |
public | function | Allows for backend specific overrides to the settings form. | |
FacetapiAdapter:: |
public | function | Returns TRUE if the back-end supports "minimum facet counts". | |
FacetapiAdapter:: |
public | function | Returns TRUE if the backend supports "missing" facets. | |
FacetapiAdapter:: |
public | function | Constructs a FacetapiAdapter object. | |
FacetapiTestAdapter:: |
protected | property | The total number of results in the query. | |
FacetapiTestAdapter:: |
public | function |
Overrides FacetapiAdapter::getResultCount(). Overrides FacetapiAdapter:: |
|
FacetapiTestAdapter:: |
public | function |
Overrides FacetapiAdapter::getSearchPath(). Overrides FacetapiAdapter:: |
|
FacetapiTestAdapter:: |
public | function |
Implements FacetapiAdapter::searchExecuted(). Overrides FacetapiAdapter:: |
|
FacetapiTestAdapter:: |
public | function | Sets the result count. | |
FacetapiTestAdapter:: |
public | function |
Implements FacetapiAdapter::suppressOutput(). Overrides FacetapiAdapter:: |