You are here

public function Webform::deleteWebformHandler in Webform 8.5

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

Deletes a webform handler from this webform.

Parameters

\Drupal\webform\Plugin\WebformHandlerInterface $handler: The webform handler object.

Return value

$this

Overrides WebformInterface::deleteWebformHandler

File

src/Entity/Webform.php, line 2672

Class

Webform
Defines the webform entity.

Namespace

Drupal\webform\Entity

Code

public function deleteWebformHandler(WebformHandlerInterface $handler) {
  $handler
    ->setWebform($this);
  $this
    ->getHandlers()
    ->removeInstanceId($handler
    ->getHandlerId());
  $handler
    ->deleteHandler();
  $this
    ->save();
  $this
    ->resetHandlers();
  return $this;
}