public function evaluateContextConditions(ContextInterface $context, array $provided = []) {
    $conditions = $context->getConditions();

    // Apply context to any context aware conditions.
    $this->applyContexts($conditions, $provided);

    // Set the logic to use when validating the conditions.
    $logic = $context->requiresAllConditions()
      ? 'and'
      : 'or';

    // Of there are no conditions then the context will be
    // applied as a site wide context.
    if (!count($conditions)) {
      $logic = 'and';
    }

    return $this->resolveConditions($conditions, $logic);
  }
public function evaluateContextConditions(ContextInterface $context, array $provided = []) {
    $conditions = $context->getConditions();

    // Apply context to any context aware conditions.
    $this->applyContexts($conditions, $provided);

    // Set the logic to use when validating the conditions.
    $logic = $context->requiresAllConditions()
      ? 'and'
      : 'or';

    // Of there are no conditions then the context will be
    // applied as a site wide context.
    if (!count($conditions)) {
      $logic = 'and';
    }

    return $this->resolveConditions($conditions, $logic);
  }
public function evaluateContextConditions ( ContextInterface $ context , array $ provided = [ ] ) { $ conditions = $ context -> getConditions ( ) ; // Apply context to any context aware conditions. $ this -> applyContexts ( $ conditions , $ provided ) ; // Set the logic to use when validating the conditions. $ logic = $ context -> requiresAllConditions ( ) ? 'and' : 'or' ; // Of there are no conditions then the context will be // applied as a site wide context. if ( ! count ( $ conditions ) ) { $ logic = 'and' ; } return $ this -> resolveConditions ( $ conditions , $ logic ) ; }
Evaluate a contexts conditions.

@param \Drupal\context\ContextInterface $context
The context to evaluate conditions for.
@param \Drupal\Core\Plugin\Context\Context[] $provided
Additional provided (core) contexts to apply to Conditions.

@return bool
TRUE if conditions pass
Evaluate a contexts conditions .