You are here

function facetapi_requirement_property_set in Facet API 7

Same name and namespace in other branches
  1. 6.3 facetapi.requirements.inc \facetapi_requirement_property_set()
  2. 7.2 facetapi.requirements.inc \facetapi_requirement_property_set()

Checks whether one or more properties are set.

Parameters

array $definition: The facet or realm definition.

array $options: An array of boolean statuses keyed by properties being checked.

Return value

TRUE if all properties match the passed statues, FALSE otherwise.

2 calls to facetapi_requirement_property_set()
facetapi_requirement_facet_property_set in ./facetapi.requirements.inc
Checks whether one or more facet properties are set.
facetapi_requirement_realm_property_set in ./facetapi.requirements.inc
Checks whether one or more realm properties are set.

File

./facetapi.requirements.inc, line 139
Requirement checking callbacks.

Code

function facetapi_requirement_property_set(array $definition, array $options) {
  $passed = TRUE;
  foreach ($options as $key => $requirement) {
    if (!($requirement ? !empty($definition[$key]) : empty($definition[$key]))) {
      $passed = FALSE;
      break;
    }
  }
  return $passed;
}