You are here

function SarniaSolrService::schemaGetRule in Sarnia 7

1 call to SarniaSolrService::schemaGetRule()
SarniaSolrService::schemaApplyRules in ./service.inc

File

./service.inc, line 319

Class

SarniaSolrService
Search service class using Solr server.

Code

function schemaGetRule($field, $filter) {
  if (!isset($this->schema)) {
    $this
      ->schemaInit();
  }
  if (isset($this->schema[$filter])) {
    foreach ($this->schema[$filter] as $rule) {
      if ((!$rule->search_api_server || $rule->search_api_server == $this->server->machine_name) && ($rule->match_type == 'name' && $rule->match_value == $field
        ->getName() || $rule->match_type == 'dynamicBase' && $rule->match_value == $field
        ->getDynamicBase() || $rule->match_type == 'type' && $rule->match_value == $field
        ->getType())) {
        return $rule;
      }
    }
  }
  return FALSE;
}