You are here

public function Webform::hasMessageHandler in Webform 8.5

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

Determine if the webform has any message handlers.

Return value

bool TRUE if the webform has any message handlers.

Overrides WebformInterface::hasMessageHandler

File

src/Entity/Webform.php, line 2529

Class

Webform
Defines the webform entity.

Namespace

Drupal\webform\Entity

Code

public function hasMessageHandler() {
  if (isset($this->hasMessagehandler)) {
    $this->hasMessagehandler;
  }
  $this->hasMessagehandler = FALSE;
  $handlers = $this
    ->getHandlers();
  foreach ($handlers as $handler) {
    if ($handler instanceof WebformHandlerMessageInterface) {
      $this->hasMessagehandler = TRUE;
      break;
    }
  }
  return $this->hasMessagehandler;
}