You are here

public function FacetapiAdapter::initSettingsObject in Facet API 6.3

Same name and namespace in other branches
  1. 7.2 plugins/facetapi/adapter.inc \FacetapiAdapter::initSettingsObject()
  2. 7 plugins/facetapi/adapter.inc \FacetapiAdapter::initSettingsObject()

Initializes a new settings object.

Parameters

$name: A string containing the unique name of the configuration.

array $facet_name: A string containing the machine readable name of the facet.

$realm_name: A string containing the machine readable name of the realm, NULL if we are initializing global settings.

Return value

stdClass An object containing the initialized settings.

2 calls to FacetapiAdapter::initSettingsObject()
FacetapiAdapter::getFacetSettings in plugins/facetapi/adapter.inc
Returns realm specific settings for a facet.
FacetapiAdapter::getFacetSettingsGlobal in plugins/facetapi/adapter.inc
Returns realm specific settings for a facet.

File

plugins/facetapi/adapter.inc, line 529
Adapter plugin and adapter related calsses.

Class

FacetapiAdapter
Abstract class extended by search backends that retrieves facet information from the database.

Code

public function initSettingsObject($name, $facet_name, $realm_name = NULL) {
  $cached_settings = facetapi_get_searcher_settings($this->info['name']);
  if (!isset($cached_settings[$name])) {
    $settings = ctools_export_crud_new('facetapi');
    $settings->name = $name;
    $settings->searcher = $this->info['name'];
    $settings->realm = (string) $realm_name;
    $settings->facet = $facet_name;
    $settings->enabled = 0;
    $settings->settings = array();
  }
  else {
    $settings = $cached_settings[$name];
  }
  return $settings;
}