You are here

public function Webform::hasMessageHandler in Webform 6.x

Same name and namespace in other branches
  1. 8.5 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 2530

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;
}