You are here

protected function Webform::isHandlerEnabled in Webform 8.5

Same name and namespace in other branches
  1. 6.x src/Entity/Webform.php \Drupal\webform\Entity\Webform::isHandlerEnabled()

Determine if a webform handler is enabled.

Parameters

\Drupal\webform\Plugin\WebformHandlerInterface $handler: A webform handler.

\Drupal\webform\WebformSubmissionInterface|null $webform_submission: A webform submission.

Return value

bool TRUE if a webform handler is enabled.

1 call to Webform::isHandlerEnabled()
Webform::invokeHandlers in src/Entity/Webform.php
Invoke a handlers method.

File

src/Entity/Webform.php, line 2757

Class

Webform
Defines the webform entity.

Namespace

Drupal\webform\Entity

Code

protected function isHandlerEnabled(WebformHandlerInterface $handler, WebformSubmissionInterface $webform_submission = NULL) {

  // Check if the handler is disabled.
  if ($handler
    ->isDisabled()) {
    return FALSE;
  }
  elseif ($webform_submission && !$handler
    ->checkConditions($webform_submission)) {
    return FALSE;
  }
  else {
    return TRUE;
  }
}