You are here

public function FacetapiAdapter::initSettingsObject in Facet API 7

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

Initializes a new settings object.

Parameters

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

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

string $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.

See also

ctools_export_crud_new()

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 global settings for a facet.

File

plugins/facetapi/adapter.inc, line 725
Adapter plugin and adapter related classes.

Class

FacetapiAdapter
Abstract class extended by Facet API adapters.

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->hash = facetapi_hash_delta($name);
    $settings->settings = array();
  }
  else {
    $settings = $cached_settings[$name];
  }
  return $settings;
}