You are here

public function FacetapiQueryTypeInterface::build in Facet API 7

Same name and namespace in other branches
  1. 6.3 plugins/facetapi/query_type.inc \FacetapiQueryTypeInterface::build()
  2. 7.2 plugins/facetapi/query_type.inc \FacetapiQueryTypeInterface::build()

Gets data from the server and adds values to the facet's render array.

At a minimum this method should add the index values returned by the search server as keys containing associative arrays with the "#count" key. The end result will be an array structured like the one below:

<code> $build = array( 'index-value-1' => array('#count' => 3), 'index-value-2' => array('#count' => 19), 'index-value-3' => array('#count' => 82), ... ); </code>

See the return of the FacetapiFacetProcessor::initializeBuild() for all possible values that could be populated. Query type plugins such as "date" types will populte the #item_children, #item_parents, and #active keys in addition to #count.

Return value

array The initialized render array. For all possible values of the structure of the array, see the FacetapiFacetProcessor::initializeBuild() docblock. Usually only the #count key is used.

See also

FacetapiFacetProcessor::initializeBuild()

2 methods override FacetapiQueryTypeInterface::build()
FacetapiTestNonterm::build in tests/facetapi_test.plugins.inc
Implements FacetapiQueryTypeInterface::build().
FacetapiTestTerm::build in tests/facetapi_test.plugins.inc
Implements FacetapiQueryTypeInterface::build().

File

plugins/facetapi/query_type.inc, line 109
Interfaces and base classes for query type plugins.

Class

FacetapiQueryTypeInterface
Interface implemented by all query type plugins.

Code

public function build();