You are here

public function Context::hasCondition in Context 8.4

Same name and namespace in other branches
  1. 8 src/Entity/Context.php \Drupal\context\Entity\Context::hasCondition()
  2. 8.0 src/Entity/Context.php \Drupal\context\Entity\Context::hasCondition()

Check to see if the context has the specified condition.

Parameters

string $condition_id: The ID of the condition to check for.

Return value

bool TRUE if the context has the specified condition, FALSE if not.

Overrides ContextInterface::hasCondition

File

src/Entity/Context.php, line 298

Class

Context
Defines the Context entity.

Namespace

Drupal\context\Entity

Code

public function hasCondition($condition_id) {
  return $this
    ->getConditions()
    ->has($condition_id);
}