You are here

public function GroupType::evaluate in Organic groups 8

Evaluates the condition and returns TRUE or FALSE accordingly.

Return value

bool TRUE if the condition has been met, FALSE otherwise.

Overrides ConditionInterface::evaluate

File

src/Plugin/Condition/GroupType.php, line 154

Class

GroupType
Provides a 'Group Type' block visibility condition.

Namespace

Drupal\og\Plugin\Condition

Code

public function evaluate() {
  if (empty($this->configuration['group_types']) && !$this
    ->isNegated()) {
    return TRUE;
  }
  $group = $this
    ->getContextValue('og');
  $key = $group
    ->getEntityTypeId() . '-' . $group
    ->bundle();
  return !empty($this->configuration['group_types'][$key]);
}