You are here

function facetapi_facet_enabled in Facet API 7

Same name and namespace in other branches
  1. 6.3 facetapi.module \facetapi_facet_enabled()
  2. 6 facetapi.module \facetapi_facet_enabled()
  3. 7.2 facetapi.module \facetapi_facet_enabled()

Tests whether a single facet is enabled in a given realm.

Parameters

string $searcher: The machine readable name of the searcher.

string $realm_name: The machine readable name of the realm, pass NULL to test if the facet is enabled in at least one realm.

string $facet_name: The machine readable name of the facet.

Return value

bool A boolean flagging whether the facet is enabled in the passed realm.

5 calls to facetapi_facet_enabled()
FacetapiApiFunctions::testFacetEnabled in tests/facetapi.test
Tests the facetapi_facet_enabled() function.
FacetapiApiFunctions::testSaveFacetStatus in tests/facetapi.test
Tests facetapi_save_facet_status() API functions.
FacetapiApiFunctions::testSetFacetStatus in tests/facetapi.test
Tests facetapi_set_facet_status() API functions.
FacetapiTestCase::facetapiEnableFacet in tests/facetapi.test
Enables a facet via the UI.
facetapi_check_block_visibility in ./facetapi.block.inc
Checks whether the block should be displayed.

File

./facetapi.module, line 981
An abstracted facet API that can be used by various search backends.

Code

function facetapi_facet_enabled($searcher, $realm_name, $facet_name) {
  $enabled_facets = facetapi_get_enabled_facets($searcher, $realm_name, $facet_name);
  return isset($enabled_facets[$facet_name]);
}